summaryrefslogtreecommitdiff
path: root/gcc/protoize.c
diff options
context:
space:
mode:
authorBruce Korb <bkorb@gnu.org>2001-03-16 00:58:40 +0000
committerBruce Korb <korbb@gcc.gnu.org>2001-03-16 00:58:40 +0000
commit798bdf70eee560a3ca67a44dbb64397ee709b438 (patch)
treee6a1cdc10e704951d9a367c7c321e213df085ee0 /gcc/protoize.c
parent243baa2871d2f28673f3b17282d0efb278b9684d (diff)
downloadgcc-798bdf70eee560a3ca67a44dbb64397ee709b438.tar.gz
more rigorous SIGCHLD guarding
From-SVN: r40522
Diffstat (limited to 'gcc/protoize.c')
-rw-r--r--gcc/protoize.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 6780b002161..aa03edf233f 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */
#include <setjmp.h>
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -4583,6 +4586,12 @@ main (argc, argv)
#endif
pname = pname ? pname+1 : argv[0];
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
/* LC_CTYPE determines the character set used by the terminal so it has be set
to output messages correctly. */