From 31ab5ebe1eb914d3707af9901ddf1f9330ad7d98 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 21 May 2001 10:24:52 +0000 Subject: Fix patches from HMH and others. svn path=/trunk/; revision=3317 --- daemon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'daemon.c') 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) -- cgit v1.2.3