summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2006-11-05 14:49:47 +0000
committertrhodes <trhodes@FreeBSD.org>2006-11-05 14:49:47 +0000
commit2d47ae4d926dbc8e5f872614d6fc648640bb1332 (patch)
tree271dfb74e50e666a984434a805d2217fa6f9872f /sbin
parentcd38181372bfd4a1d8c035e26c87685d49a07783 (diff)
downloadFreeBSD-src-2d47ae4d926dbc8e5f872614d6fc648640bb1332.zip
FreeBSD-src-2d47ae4d926dbc8e5f872614d6fc648640bb1332.tar.gz
Sync up with rhyolite routed 2.31 which fixes the handling of varargs.
Remove -p from usage, it's gone completely now. PR: 83387 Submited by: arved
Diffstat (limited to 'sbin')
-rw-r--r--sbin/routed/main.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sbin/routed/main.c b/sbin/routed/main.c
index 722061e..7c3c5ac 100644
--- a/sbin/routed/main.c
+++ b/sbin/routed/main.c
@@ -47,8 +47,8 @@ __RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
-__RCSID("$Revision: 2.27 $");
-#ident "$Revision: 2.27 $"
+__RCSID("$Revision: 2.31 $");
+#ident "$Revision: 2.31 $"
#endif
pid_t mypid;
@@ -133,7 +133,7 @@ main(int argc,
(void)gethostname(myname, sizeof(myname)-1);
(void)gethost(myname, &myaddr);
- while ((n = getopt(argc, argv, "sqdghmpAtvT:F:P:")) != -1) {
+ while ((n = getopt(argc, argv, "sqdghmAtvT:F:P:")) != -1) {
switch (n) {
case 's':
supplier = 1;
@@ -219,7 +219,7 @@ main(int argc,
case 'v':
/* display version */
verbose++;
- msglog("version 2.25");
+ msglog("version 2.31");
break;
default:
@@ -237,7 +237,7 @@ main(int argc,
goto usage;
if (argc != 0) {
usage:
- logbad(0, "usage: routed [-sqdghmpAtv] [-T tracefile]"
+ logbad(0, "usage: routed [-sqdghmAtv] [-T tracefile]"
" [-F net[,metric]] [-P parms]");
}
if (geteuid() != 0) {
@@ -863,14 +863,15 @@ msglog(const char *p, ...)
va_start(args, p);
vsyslog(LOG_ERR, p, args);
-
+ va_end(args);
if (ftrace != 0) {
if (ftrace == stdout)
(void)fputs("routed: ", ftrace);
+ va_start(args, p);
(void)vfprintf(ftrace, p, args);
+ va_end(args);
(void)fputc('\n', ftrace);
}
- va_end(args);
}
@@ -889,8 +890,6 @@ msglim(struct msg_limit *lim, naddr addr, const char *p, ...)
struct msg_sub *ms1, *ms;
const char *p1;
- va_start(args, p);
-
/* look for the oldest slot in the table
* or the slot for the bad router.
*/
@@ -925,15 +924,18 @@ msglim(struct msg_limit *lim, naddr addr, const char *p, ...)
trace_flush();
for (p1 = p; *p1 == ' '; p1++)
continue;
+ va_start(args, p);
vsyslog(LOG_ERR, p1, args);
+ va_end(args);
}
/* always display the message if tracing */
if (ftrace != 0) {
+ va_start(args, p);
(void)vfprintf(ftrace, p, args);
+ va_end(args);
(void)fputc('\n', ftrace);
}
- va_end(args);
}
@@ -946,12 +948,13 @@ logbad(int dump, const char *p, ...)
va_start(args, p);
vsyslog(LOG_ERR, p, args);
-
+ va_end(args);
(void)fputs("routed: ", stderr);
+ va_start(args, p);
(void)vfprintf(stderr, p, args);
+ va_end(args);
(void)fputs("; giving up\n",stderr);
(void)fflush(stderr);
- va_end(args);
if (dump)
abort();
OpenPOWER on IntegriCloud