!25 Continue build when test-case(features/output-sync) failed and Handle SIGPIPE as a fatal signal

From: @fly_fzc 
Reviewed-by: @overweight 
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2023-01-11 06:15:30 +00:00 committed by Gitee
commit d5215393bb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,39 @@
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: * 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

View File

@ -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 <fuanan3@h-partners.com> - 1:4.4-2
- Continue build when test-case(features/output-sync) failed
- Handle SIGPIPE as a fatal signal
* Wed Nov 09 2022 fuanan <fuanan3@h-partners.com> - 1:4.4-1
- update version to 4.4