aboutsummaryrefslogtreecommitdiff
path: root/sbin/routed
diff options
context:
space:
mode:
authorTom Rhodes <trhodes@FreeBSD.org>2006-11-05 14:49:47 +0000
committerTom Rhodes <trhodes@FreeBSD.org>2006-11-05 14:49:47 +0000
commita4fff644c3327ac873a8b77e719d05a32b35fad3 (patch)
tree271dfb74e50e666a984434a805d2217fa6f9872f /sbin/routed
parent9274ba8a1f4e7c5a2e66d1b847a14c8192179f93 (diff)
downloadsrc-a4fff644c3327ac873a8b77e719d05a32b35fad3.tar.gz
src-a4fff644c3327ac873a8b77e719d05a32b35fad3.zip
Notes
Diffstat (limited to 'sbin/routed')
-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 722061e80374..7c3c5acc8697 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();