aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-05-21 10:24:52 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-05-21 10:24:52 +0000
commit31ab5ebe1eb914d3707af9901ddf1f9330ad7d98 (patch)
tree0b10c6d982511bba6f602035e8cd12cc440403b0 /daemon.c
parent9944ca8e0b1674291d32ccb83262a9f717d09e69 (diff)
downloadfetchmail-31ab5ebe1eb914d3707af9901ddf1f9330ad7d98.tar.gz
fetchmail-31ab5ebe1eb914d3707af9901ddf1f9330ad7d98.tar.bz2
fetchmail-31ab5ebe1eb914d3707af9901ddf1f9330ad7d98.zip
Fix patches from HMH and others.
svn path=/trunk/; revision=3317
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)