summaryrefslogtreecommitdiff
path: root/usr.sbin/switchd
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2016-09-20 16:45:10 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2016-09-20 16:45:10 +0000
commita9a8b66de89316e8ef2d8d068f0deb37e781ae69 (patch)
treead23843f78b64d35e5a374a8fbcfa2a412818f54 /usr.sbin/switchd
parent2668d1a9a62ee13ed64c7ba12b8b6d4f59d9afdf (diff)
Unbreak logging for children process in switchd(8). log_init/verbose()
must be called before proc_init() otherwise child process won't have this configured. ok reyk@
Diffstat (limited to 'usr.sbin/switchd')
-rw-r--r--usr.sbin/switchd/switchd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/switchd/switchd.c b/usr.sbin/switchd/switchd.c
index 45311dad0b4..1fbdcce24df 100644
--- a/usr.sbin/switchd/switchd.c
+++ b/usr.sbin/switchd/switchd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchd.c,v 1.9 2016/09/15 15:52:22 rzalamena Exp $ */
+/* $OpenBSD: switchd.c,v 1.10 2016/09/20 16:45:09 rzalamena Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -172,6 +172,9 @@ main(int argc, char *argv[])
if ((ps->ps_pw = getpwnam(SWITCHD_USER)) == NULL)
fatalx("unknown user " SWITCHD_USER);
+ log_init(debug, LOG_DAEMON);
+ log_verbose(verbose);
+
/* Configure the control socket */
ps->ps_csock.cs_name = SWITCHD_SOCKET;
ps->ps_instance = proc_instance;
@@ -181,9 +184,6 @@ main(int argc, char *argv[])
/* Only the parent returns. */
proc_init(ps, procs, nitems(procs), argc0, argv, proc_id);
- log_init(debug, LOG_DAEMON);
- log_verbose(verbose);
-
if (!debug && daemon(0, 0) == -1)
fatal("failed to daemonize");