mirror of
https://github.com/mirror/make.git
synced 2025-01-17 07:40:24 +08:00
* src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal signal
Always ignoring SIGPIPE is visible to child processes.
This commit is contained in:
parent
deb4ff272a
commit
92ab2e642d
@ -1182,11 +1182,6 @@ main (int argc, char **argv, char **envp)
|
|||||||
/* Useful for attaching debuggers, etc. */
|
/* Useful for attaching debuggers, etc. */
|
||||||
SPIN ("main-entry");
|
SPIN ("main-entry");
|
||||||
|
|
||||||
/* Don't die if our stdout sends us SIGPIPE. */
|
|
||||||
#ifdef SIGPIPE
|
|
||||||
bsd_signal (SIGPIPE, SIG_IGN);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ATEXIT
|
#ifdef HAVE_ATEXIT
|
||||||
if (ANY_SET (check_io_state (), IO_STDOUT_OK))
|
if (ANY_SET (check_io_state (), IO_STDOUT_OK))
|
||||||
atexit (close_stdout);
|
atexit (close_stdout);
|
||||||
@ -1264,6 +1259,9 @@ main (int argc, char **argv, char **envp)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef SIGQUIT
|
#ifdef SIGQUIT
|
||||||
FATAL_SIG (SIGQUIT);
|
FATAL_SIG (SIGQUIT);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGPIPE
|
||||||
|
FATAL_SIG (SIGPIPE);
|
||||||
#endif
|
#endif
|
||||||
FATAL_SIG (SIGINT);
|
FATAL_SIG (SIGINT);
|
||||||
FATAL_SIG (SIGTERM);
|
FATAL_SIG (SIGTERM);
|
||||||
|
Loading…
Reference in New Issue
Block a user