SHA256
3
0
forked from pool/make
make/sigpipe-fatal.patch
Andreas Schwab 97e81fd2eb Accepting request 1037051 from home:Andreas_Schwab:Factory
- reset-sigpipe.patch: Removed
- sigpipe-fatal.patch: Handle SIGPIPE as a fatal signal

OBS-URL: https://build.opensuse.org/request/show/1037051
OBS-URL: https://build.opensuse.org/package/show/Base:System/make?expand=0&rev=81
2022-11-21 09:41:39 +00:00

41 lines
1.0 KiB
Diff

From 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74 Mon Sep 17 00:00:00 2001
From: Paul Smith <psmith@gnu.org>
Date: Sun, 6 Nov 2022 15:22:02 -0500
Subject: [PATCH] * src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal
signal
Always ignoring SIGPIPE is visible to child processes.
---
src/main.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/main.c b/src/main.c
index eec93656..f2caf7a8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);
--
2.38.1