summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2011-08-20 11:16:09 +0000
committersthen <sthen@openbsd.org>2011-08-20 11:16:09 +0000
commit49ed4438205fca29ca5759cdf9a291222f225a5b (patch)
tree45458000854a00cb6b31e40eeb30d2d65f70c8d4
parentevent_del() a persistent event; fixes segfault seen on the server when the (diff)
downloadwireguard-openbsd-49ed4438205fca29ca5759cdf9a291222f225a5b.tar.xz
wireguard-openbsd-49ed4438205fca29ca5759cdf9a291222f225a5b.zip
Decouple log_verbose() from log_init() so the verbose flag stays set with
"ospfd -v" (previously only "-vd" worked). Feedback on earlier implementation from henning@ blambert@ claudio@, ok claudio@
-rw-r--r--usr.sbin/ospfd/log.c3
-rw-r--r--usr.sbin/ospfd/ospfd.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/log.c b/usr.sbin/ospfd/log.c
index e8326b81d45..c75448e98c5 100644
--- a/usr.sbin/ospfd/log.c
+++ b/usr.sbin/ospfd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.6 2009/11/02 20:20:54 claudio Exp $ */
+/* $OpenBSD: log.c,v 1.7 2011/08/20 11:16:09 sthen Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -44,7 +44,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);
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index bcead835b3a..42d19b75c43 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.77 2011/05/06 13:50:37 claudio Exp $ */
+/* $OpenBSD: ospfd.c,v 1.78 2011/08/20 11:16:09 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -139,6 +139,7 @@ main(int argc, char *argv[])
sockname = OSPFD_SOCKET;
log_init(1); /* log to stderr until daemonized */
+ log_verbose(1);
while ((ch = getopt(argc, argv, "cdD:f:ns:v")) != -1) {
switch (ch) {
@@ -166,7 +167,6 @@ main(int argc, char *argv[])
if (opts & OSPFD_OPT_VERBOSE)
opts |= OSPFD_OPT_VERBOSE2;
opts |= OSPFD_OPT_VERBOSE;
- log_verbose(1);
break;
default:
usage();
@@ -222,6 +222,7 @@ main(int argc, char *argv[])
errx(1, "unknown user %s", OSPFD_USER);
log_init(debug);
+ log_verbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE);
if (!debug)
daemon(1, 0);