From b8bac1a1ba5e3596e48fd69b5f12e13bcc143b70 Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Wed, 11 Jan 2023 12:10:56 +0800 Subject: [PATCH] Continue build when test-case(features/output-sync) failed and Handle SIGPIPE as a fatal signal --- ...ort-Handle-SIGPIPE-as-a-fatal-signal.patch | 39 +++++++++++++++++++ make.spec | 16 +++++++- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 backport-Handle-SIGPIPE-as-a-fatal-signal.patch diff --git a/backport-Handle-SIGPIPE-as-a-fatal-signal.patch b/backport-Handle-SIGPIPE-as-a-fatal-signal.patch new file mode 100644 index 0000000..4cde604 --- /dev/null +++ b/backport-Handle-SIGPIPE-as-a-fatal-signal.patch @@ -0,0 +1,39 @@ +From 92ab2e642d2c04b3dcb5a736ae6193680bfd5f74 Mon Sep 17 00:00:00 2001 +From: Paul Smith +Date: Sun, 6 Nov 2022 15:22:02 -0500 +Subject: * 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 eec9365..f2caf7a 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); +@@ -1265,6 +1260,9 @@ main (int argc, char **argv, char **envp) + #ifdef SIGQUIT + FATAL_SIG (SIGQUIT); + #endif ++#ifdef SIGPIPE ++ FATAL_SIG (SIGPIPE); ++#endif + FATAL_SIG (SIGINT); + FATAL_SIG (SIGTERM); + +-- +cgit v1.1 + diff --git a/make.spec b/make.spec index 60c2db5..7d0e06f 100644 --- a/make.spec +++ b/make.spec @@ -1,12 +1,14 @@ Name: make Epoch: 1 Version: 4.4 -Release: 1 +Release: 2 Summary: A tool which controls the generation of executables and non-source files of a program License: GPLv3+ URL: http://www.gnu.org/software/make/ Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz +Patch0: backport-Handle-SIGPIPE-as-a-fatal-signal.patch + BuildRequires: gcc git autoconf automake procps BuildRequires: guile-devel perl-interpreter make Requires(post): /sbin/install-info @@ -54,7 +56,13 @@ rm -f %{buildroot}/%{_infodir}/dir if [ "%{_smp_mflags}" = "-j2" ]; then echo "test will fail with make -j2 check" else -/usr/bin/env LANG=C make check +/usr/bin/env LANG=C make check || { + for f in tests/work/*/*.diff; do + test -f "$f" || continue + printf "++++++++++++++ %s ++++++++++++++\n" "${f##*/}" + cat "$f" + done +} fi %post @@ -84,6 +92,10 @@ fi %{_infodir}/* %changelog +* Wed Jan 11 2023 fuanan - 1:4.4-2 +- Continue build when test-case(features/output-sync) failed +- Handle SIGPIPE as a fatal signal + * Wed Nov 09 2022 fuanan - 1:4.4-1 - update version to 4.4 -- Gitee