diff options
author | Roland McGrath <roland@redhat.com> | 1992-06-11 05:12:44 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1992-06-11 05:12:44 +0000 |
commit | 2f5b18ba2ff9c8ab8290fbd573e034f4a0d20a59 (patch) | |
tree | dfeac9229efcd603fac926380e3073a2c0659878 /commands.c | |
parent | 5631243fddce1ab03f4c140fa0ebe1e766f60699 (diff) | |
download | gunmake-2f5b18ba2ff9c8ab8290fbd573e034f4a0d20a59.tar.gz |
Formerly commands.c.~6~
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -25,7 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ extern int remote_kill (); -#if !defined(POSIX) && !defined(__GNU_LIBRARY__) +#ifndef HAVE_UNISTD_H extern int getpid (); #endif @@ -357,19 +357,24 @@ execute_file_commands (file) new_job (file); } -#define PROPAGATED_SIGNAL_MASK \ - (sigmask (SIGTERM) | sigmask (SIGINT) | sigmask (SIGHUP) | sigmask (SIGQUIT)) - /* Handle fatal signals. */ -int +RETSIGTYPE fatal_error_signal (sig) int sig; { signal (sig, SIG_DFL); -#ifndef USG +#ifdef POSIX + { + sigset_t set; + sigemptyset (&set); + (void) sigprocmask (SIG_SETMASK, &set, (sigset_t *) 0); + } +#else +#ifndef SIGSETMASK_MISSING (void) sigsetmask (0); #endif +#endif /* A termination signal won't be sent to the entire process group, but it means we want to kill the children. */ @@ -385,7 +390,7 @@ fatal_error_signal (sig) /* If we got a signal that means the user wanted to kill make, remove pending targets. */ - if (PROPAGATED_SIGNAL_MASK & sigmask (sig)) + if (sig == SIGTERM || sig == SIGINT || sig == SIGHUP || sig == SIGQUIT) { register struct child *c; |