diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-01-11 03:51:09 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-01-11 03:51:09 +0000 |
commit | 1e286bf79bcff9bd04964a6d4b7b0773a1e7afa6 (patch) | |
tree | 0fbc05365ca874a6326cdf81a3b8732218b12bfa /usr.sbin/rtadvd/rtadvd.c | |
parent | 9f1463a8c6c1b28e4c9707469ac02a119f30e7d6 (diff) |
call daemon(3) prior to socket setups to avoid file descriptor close mistakes.
noted by markus, sync with kame
Diffstat (limited to 'usr.sbin/rtadvd/rtadvd.c')
-rw-r--r-- | usr.sbin/rtadvd/rtadvd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index f0234f89de5..83342fbcd61 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtadvd.c,v 1.12 2001/12/01 23:27:23 miod Exp $ */ +/* $OpenBSD: rtadvd.c,v 1.13 2002/01/11 03:51:08 itojun Exp $ */ /* $KAME: rtadvd.c,v 1.50 2001/02/04 06:15:15 itojun Exp $ */ /* @@ -234,11 +234,12 @@ main(argc, argv) fprintf(stderr, "fatal: inet_pton failed\n"); exit(1); } - sock_open(); if (!fflag) daemon(1, 0); + sock_open(); + /* record the current PID */ if (pidfile(NULL) < 0) { syslog(LOG_ERR, |