diff options
Diffstat (limited to 'usr.sbin/faithd/faithd.c')
-rw-r--r-- | usr.sbin/faithd/faithd.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/faithd/faithd.c b/usr.sbin/faithd/faithd.c index 223bc3ef408..8bb6b8d5d85 100644 --- a/usr.sbin/faithd/faithd.c +++ b/usr.sbin/faithd/faithd.c @@ -1,5 +1,5 @@ -/* $OpenBSD: faithd.c,v 1.10 2001/02/15 17:37:33 itojun Exp $ */ -/* $KAME: faithd.c,v 1.35 2001/02/10 05:24:52 itojun Exp $ */ +/* $OpenBSD: faithd.c,v 1.11 2001/03/20 01:13:54 itojun Exp $ */ +/* $KAME: faithd.c,v 1.38 2001/02/27 06:46:52 itojun Exp $ */ /* * Copyright (C) 1997 and 1998 WIDE Project. @@ -784,13 +784,25 @@ sig_terminate(int sig) static void start_daemon(void) { +#ifdef SA_NOCLDWAIT + struct sigaction sa; +#endif + if (daemon(0, 0) == -1) exit_stderr("daemon: %s", ERRSTR); +#ifdef SA_NOCLDWAIT + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = sig_child; + sa.sa_flags = SA_NOCLDWAIT; + sigemptyset(&sa.sa_mask); + sigaction(SIGCHLD, &sa, (struct sigaction *)0); +#else if (signal(SIGCHLD, sig_child) == SIG_ERR) { exit_failure("signal CHLD: %s", ERRSTR); /*NOTREACHED*/ } +#endif if (signal(SIGTERM, sig_terminate) == SIG_ERR) { exit_failure("signal TERM: %s", ERRSTR); |