Commit 798bdf70 by Bruce Korb Committed by Bruce Korb

more rigorous SIGCHLD guarding

From-SVN: r40522
parent 243baa28
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> 2001-03-15 Mark Mitchell <mark@codesourcery.com>
* sdbout.c (sdbout_symbol): Use DECL_RTL_SET_P, SET_DECL_RTL. * sdbout.c (sdbout_symbol): Use DECL_RTL_SET_P, SET_DECL_RTL.
......
...@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include <signal.h> #include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
#ifdef vfork /* Autoconf may define this to fork for us. */ #ifdef vfork /* Autoconf may define this to fork for us. */
# define VFORK_STRING "fork" # define VFORK_STRING "fork"
...@@ -869,6 +872,12 @@ main (argc, argv) ...@@ -869,6 +872,12 @@ main (argc, argv)
COLLECT2_HOST_INITIALIZATION; COLLECT2_HOST_INITIALIZATION;
#endif #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 /* LC_CTYPE determines the character set used by the terminal so it has be set
to output messages correctly. */ to output messages correctly. */
......
...@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */
#endif #endif
#include <signal.h> #include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
#ifndef SEPARATE_FIX_PROC #ifndef SEPARATE_FIX_PROC
#include "server.h" #include "server.h"
#endif #endif
...@@ -249,6 +252,12 @@ ENV_TABLE ...@@ -249,6 +252,12 @@ ENV_TABLE
exit (EXIT_FAILURE); 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; \ #define _ENV_(v,m,n,t) { tSCC var[] = n; \
v = getenv (var); if (m && (v == NULL)) { \ v = getenv (var); if (m && (v == NULL)) { \
fprintf (stderr, var_not_found, var); \ fprintf (stderr, var_not_found, var); \
......
...@@ -73,6 +73,9 @@ compilation is specified by a string called a "spec". */ ...@@ -73,6 +73,9 @@ compilation is specified by a string called a "spec". */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include <signal.h> #include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
#include "obstack.h" #include "obstack.h"
#include "intl.h" #include "intl.h"
#include "prefix.h" #include "prefix.h"
...@@ -5517,9 +5520,11 @@ main (argc, argv) ...@@ -5517,9 +5520,11 @@ main (argc, argv)
if (signal (SIGPIPE, SIG_IGN) != SIG_IGN) if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
signal (SIGPIPE, fatal_error); signal (SIGPIPE, fatal_error);
#endif #endif
#ifdef SIGCHLD
/* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
receive the signal. A different setting is inheritable */ receive the signal. A different setting is inheritable */
signal (SIGCHLD, SIG_DFL); signal (SIGCHLD, SIG_DFL);
#endif
argbuf_length = 10; argbuf_length = 10;
argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *)); argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *));
......
...@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
# define SIGCHLD SIGCLD
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
...@@ -4583,6 +4586,12 @@ main (argc, argv) ...@@ -4583,6 +4586,12 @@ main (argc, argv)
#endif #endif
pname = pname ? pname+1 : argv[0]; 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 /* LC_CTYPE determines the character set used by the terminal so it has be set
to output messages correctly. */ to output messages correctly. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment