From 4e475032328d5fdaead5daaf6a00a46979cabf6e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 12 May 2001 05:08:15 +0000 Subject: SA_RESTART and portability fixes. svn path=/trunk/; revision=3301 --- daemon.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'daemon.c') 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 -- cgit v1.2.3