summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2011-08-20 19:02:29 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2011-08-20 19:02:29 +0000
commitabb7f3e568a613a7d6daf6af3556386e08bfee52 (patch)
treee138e84c6cdd55dfd8570964868e01deff349f80 /usr.sbin/ldpd
parent564f667f41c7007f68568b2bbaabd0b6204a0055 (diff)
Decouple log_verbose() from log_init() so the verbose flag stays set with
"-v" (previously only "-vd" worked). Similar to recent ospfd commit. ok claudio@
Diffstat (limited to 'usr.sbin/ldpd')
-rw-r--r--usr.sbin/ldpd/ldpd.c5
-rw-r--r--usr.sbin/ldpd/log.c3
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c
index 948679fa4fa..3ad0b161273 100644
--- a/usr.sbin/ldpd/ldpd.c
+++ b/usr.sbin/ldpd/ldpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.c,v 1.12 2010/09/01 13:54:54 claudio Exp $ */
+/* $OpenBSD: ldpd.c,v 1.13 2011/08/20 19:02:28 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -134,6 +134,7 @@ main(int argc, char *argv[])
ldpd_process = PROC_MAIN;
log_init(1); /* log to stderr until daemonized */
+ log_verbose(1);
while ((ch = getopt(argc, argv, "dD:f:nv")) != -1) {
switch (ch) {
@@ -155,7 +156,6 @@ main(int argc, char *argv[])
if (opts & LDPD_OPT_VERBOSE)
opts |= LDPD_OPT_VERBOSE2;
opts |= LDPD_OPT_VERBOSE;
- log_verbose(1);
break;
default:
usage();
@@ -189,6 +189,7 @@ main(int argc, char *argv[])
errx(1, "unknown user %s", LDPD_USER);
log_init(debug);
+ log_verbose(opts & LDPD_OPT_VERBOSE);
if (!debug)
daemon(1, 0);
diff --git a/usr.sbin/ldpd/log.c b/usr.sbin/ldpd/log.c
index 45e063166bf..ea0befd0462 100644
--- a/usr.sbin/ldpd/log.c
+++ b/usr.sbin/ldpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.8 2010/09/02 14:34:04 claudio Exp $ */
+/* $OpenBSD: log.c,v 1.9 2011/08/20 19:02:28 sthen Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -49,7 +49,6 @@ log_init(int n_debug)
extern char *__progname;
debug = n_debug;
- verbose = n_debug;
if (!debug)
openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);