This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow $SIG{CHLD}='IGNORE' to work on Solaris
authorChip Salzenberg <chip@pobox.com>
Wed, 8 Jul 1998 18:10:55 +0000 (14:10 -0400)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 9 Jul 1998 01:48:16 +0000 (01:48 +0000)
Message-ID: <19980708181055.A8005@perlsupport.com>

p4raw-id: //depot/perl@1391

util.c

diff --git a/util.c b/util.c
index 81c4fa8..afec3d3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1957,6 +1957,10 @@ rsignal(int signo, Sighandler_t handler)
 #ifdef SA_RESTART
     act.sa_flags |= SA_RESTART;        /* SVR4, 4.3+BSD */
 #endif
+#ifdef SA_NOCLDWAIT
+    if (signo == SIGCHLD && handler == (Sighandler_t)SIG_IGN)
+       act.sa_flags |= SA_NOCLDWAIT;
+#endif
     if (sigaction(signo, &act, &oact) == -1)
        return SIG_ERR;
     else
@@ -1985,6 +1989,10 @@ rsignal_save(int signo, Sighandler_t handler, Sigsave_t *save)
 #ifdef SA_RESTART
     act.sa_flags |= SA_RESTART;        /* SVR4, 4.3+BSD */
 #endif
+#ifdef SA_NOCLDWAIT
+    if (signo == SIGCHLD && handler == (Sighandler_t)SIG_IGN)
+       act.sa_flags |= SA_NOCLDWAIT;
+#endif
     return sigaction(signo, &act, save);
 }