]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal signal
authorPaul Smith <psmith@gnu.org>
Sun, 6 Nov 2022 20:22:02 +0000 (15:22 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 13 Nov 2022 15:39:48 +0000 (10:39 -0500)
Always ignoring SIGPIPE is visible to child processes.

src/main.c

index eec9365639db97321afd5f1c58fc3558c555fac5..f2caf7a82fd9d56d242dbcdae2e42bf2441af527 100644 (file)
@@ -1182,11 +1182,6 @@ main (int argc, char **argv, char **envp)
   /* Useful for attaching debuggers, etc.  */
   SPIN ("main-entry");
 
-  /* Don't die if our stdout sends us SIGPIPE.  */
-#ifdef SIGPIPE
-  bsd_signal (SIGPIPE, SIG_IGN);
-#endif
-
 #ifdef HAVE_ATEXIT
   if (ANY_SET (check_io_state (), IO_STDOUT_OK))
     atexit (close_stdout);
@@ -1264,6 +1259,9 @@ main (int argc, char **argv, char **envp)
 #endif
 #ifdef SIGQUIT
   FATAL_SIG (SIGQUIT);
+#endif
+#ifdef SIGPIPE
+  FATAL_SIG (SIGPIPE);
 #endif
   FATAL_SIG (SIGINT);
   FATAL_SIG (SIGTERM);