aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2003-08-17 17:29:54 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2003-08-17 17:29:54 +0000
commit532ba48e39c6407e90b0170a38770cbbc2c69f0f (patch)
tree27670eaed3f026bfd9c1dbfeae33a9e479a139c1 /usr.sbin
parent8a92d72c445b28655edb02bb72e4bf7f4ff387d7 (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/route6d/route6d.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index 696a9bc112b2a..e8d06bbe6496a 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -349,6 +349,14 @@ main(argc, argv)
nflag = 1;
fprintf(stderr, "No kernel update is allowed\n");
}
+
+ if (dflag == 0) {
+ if (daemon(0, 0) < 0) {
+ fatal("daemon");
+ /*NOTREACHED*/
+ }
+ }
+
openlog(progname, LOG_NDELAY|LOG_PID, LOG_DAEMON);
logopened++;
@@ -389,21 +397,6 @@ main(argc, argv)
if (dflag)
ifrtdump(0);
- if (dflag == 0) {
-#if 1
- if (daemon(0, 0) < 0) {
- fatal("daemon");
- /*NOTREACHED*/
- }
-#else
- if (fork())
- exit(0);
- if (setsid() < 0) {
- fatal("setid");
- /*NOTREACHED*/
- }
-#endif
- }
pid = getpid();
if ((pidfile = fopen(ROUTE6D_PID, "w")) != NULL) {
fprintf(pidfile, "%d\n", pid);