aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-05-12 05:08:15 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-05-12 05:08:15 +0000
commit4e475032328d5fdaead5daaf6a00a46979cabf6e (patch)
tree0d4c1bedae4f261c3e902866c1b0e925b41f3db2 /daemon.c
parent82c1fcd560054c0d7a93712f2c24c14abe2294bf (diff)
downloadfetchmail-4e475032328d5fdaead5daaf6a00a46979cabf6e.tar.gz
fetchmail-4e475032328d5fdaead5daaf6a00a46979cabf6e.tar.bz2
fetchmail-4e475032328d5fdaead5daaf6a00a46979cabf6e.zip
SA_RESTART and portability fixes.
svn path=/trunk/; revision=3301
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index 89f733ac..eaedc1cf 100644
--- a/daemon.c
+++ b/daemon.c
@@ -90,10 +90,13 @@ void deal_with_sigchld(void)
memset (&sa_new, 0, sizeof sa_new);
sigemptyset (&sa_new.sa_mask);
- sa_new.sa_handler = SIG_IGN;
+ /* sa_new.sa_handler = SIG_IGN; pointless */
/* 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;
+#endif
sigaction (SIGCHLD, &sa_new, NULL);
#if defined(SIGPWR)
sigaction (SIGPWR, &sa_new, NULL);
@@ -127,6 +130,9 @@ daemonize (const char *logfile, void (*termhook)(int))
memset (&sa_new, 0, sizeof sa_new);
sigemptyset (&sa_new.sa_mask);
sa_new.sa_handler = SIG_IGN;
+#ifdef SA_RESTART /* SunOS 4.1 portability hack */
+ sa_new.sa_flags = SA_RESTART;
+#endif
#endif /* HAVE_SIGACTION */
#ifdef SIGTTOU
#ifndef HAVE_SIGACTION