summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-03-15 19:42:34 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-03-15 19:42:34 +0000
commit1ff62e3b37db521258bbe52c5cef714c32697ad4 (patch)
tree278027163aafbebf99ca0dea6f12d5f0ca09cc7a /usr.sbin
parentfbf96dce063a4d7da78c95fc01e41f48c8379c9c (diff)
call daemon(3) early; from tholo@; ok mcbride@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ifstated/ifstated.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c
index 2b00a32e241..19304e97814 100644
--- a/usr.sbin/ifstated/ifstated.c
+++ b/usr.sbin/ifstated/ifstated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifstated.c,v 1.15 2004/03/10 00:09:42 mcbride Exp $ */
+/* $OpenBSD: ifstated.c,v 1.16 2004/03/15 19:42:33 markus Exp $ */
/*
* Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org>
@@ -125,8 +125,6 @@ main(int argc, char *argv[])
}
}
- event_init();
-
if (opts & IFSD_OPT_NOACTION) {
if ((newconf = parse_config(configfile, opts)) == NULL)
exit(1);
@@ -134,13 +132,14 @@ main(int argc, char *argv[])
exit(0);
}
- log_init(opt_debug);
-
if (!opt_debug) {
daemon(0, 0);
setproctitle(NULL);
}
+ event_init();
+ log_init(opt_debug);
+
signal_set(&sigchld_ev, SIGCHLD, sigchld_handler, &sigchld_ev);
signal_add(&sigchld_ev, NULL);