aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index eaedc1cf..7cd05dd2 100644
--- a/daemon.c
+++ b/daemon.c
@@ -82,6 +82,11 @@ sigchld_handler (int sig)
lastsig = SIGCHLD;
}
+/*
+ * This function is called by other parts of the program to
+ * setup the sigchld handler after a change to the signal context.
+ * This is done to improve robustness of the signal handling code.
+ */
void deal_with_sigchld(void)
{
RETSIGTYPE sigchld_handler(int);
@@ -95,7 +100,7 @@ void deal_with_sigchld(void)
/* set up to catch child process termination signals */
sa_new.sa_handler = sigchld_handler;
#ifdef SA_RESTART /* SunOS 4.1 portability hack */
- sa_new.sa_flags = SA_RESTART;
+ sa_new.sa_flags = SA_RESTART | SA_NOCLDSTOP;
#endif
sigaction (SIGCHLD, &sa_new, NULL);
#if defined(SIGPWR)