]> gcc.gnu.org Git - gcc.git/commitdiff
more rigorous SIGCHLD guarding
authorBruce Korb <bkorb@gnu.org>
Fri, 16 Mar 2001 00:58:40 +0000 (00:58 +0000)
committerBruce Korb <korbb@gcc.gnu.org>
Fri, 16 Mar 2001 00:58:40 +0000 (00:58 +0000)
From-SVN: r40522

gcc/ChangeLog
gcc/collect2.c
gcc/fixinc/fixincl.c
gcc/gcc.c
gcc/protoize.c

index ad5fd8ba907da8d7f39f3377fc858ccc777093ae..c13da94446bdf1c3bbcc6245e3c69a3ae3b3000f 100644 (file)
@@ -1,3 +1,10 @@
+2001-03-15  Bruce Korb  <bkorb@gnu.org>
+
+       * gcc.c(main): make more rigorous
+       * collect2.c(main): guard against ignoring SIGCHLD
+       * protoize.c(main): ditto
+       * gcc/fixinc/fixincl.c(initialize): ditto
+
 2001-03-15  Mark Mitchell  <mark@codesourcery.com>
 
        * sdbout.c (sdbout_symbol): Use DECL_RTL_SET_P, SET_DECL_RTL.
index 1541f7cbf22dce5be9262d9fdc3af1ddab3e5719..729d62d52ed4de57a0eea9bc0d9cf0d6a030d586 100644 (file)
@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA.  */
 #include "config.h"
 #include "system.h"
 #include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+#  define SIGCHLD SIGCLD
+#endif
 
 #ifdef vfork /* Autoconf may define this to fork for us. */
 # define VFORK_STRING "fork"
@@ -869,6 +872,12 @@ main (argc, argv)
   COLLECT2_HOST_INITIALIZATION;
 #endif
 
+#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.  */
 
index 88fffbd2bd69224c6feddd66a47d8fded07c6d3c..5f1e363c652adf30fe948d957902581900e52f0a 100644 (file)
@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+#  define SIGCHLD SIGCLD
+#endif
 #ifndef SEPARATE_FIX_PROC
 #include "server.h"
 #endif
@@ -249,6 +252,12 @@ ENV_TABLE
       exit (EXIT_FAILURE);
     }
 
+#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
+
 #define _ENV_(v,m,n,t)   { tSCC var[] = n;  \
   v = getenv (var); if (m && (v == NULL)) { \
   fprintf (stderr, var_not_found, var);     \
index 8477c00306688042b218e2934ee425cfd885b646..967bbba1e7ae135e958dbf3200494c383f4117a3 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -73,6 +73,9 @@ compilation is specified by a string called a "spec".  */
 #include "config.h"
 #include "system.h"
 #include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+#  define SIGCHLD SIGCLD
+#endif
 #include "obstack.h"
 #include "intl.h"
 #include "prefix.h"
@@ -5517,9 +5520,11 @@ main (argc, argv)
   if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
     signal (SIGPIPE, fatal_error);
 #endif
+#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
 
   argbuf_length = 10;
   argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *));
index 6780b00216160c49cd13fa5cf10c19972af53dc7..aa03edf233fa0662a3d1ae37736fee602fa75fa0 100644 (file)
@@ -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.  */
 
This page took 0.122361 seconds and 5 git commands to generate.