coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: make SIGPIPE trap checking more robust


From: Pádraig Brady
Subject: [PATCH] tests: make SIGPIPE trap checking more robust
Date: Tue, 15 Nov 2022 14:01:45 +0000

* init.cfg (trap_sigpipe_or_skip_): A subshell with ignored SIGPIPE
was seen to not terminate, on Solaris 11 at least.
So protect with a timeout(1).
---
 init.cfg | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/init.cfg b/init.cfg
index 576f6ecd6..856aa2ee7 100644
--- a/init.cfg
+++ b/init.cfg
@@ -636,7 +636,10 @@ mkfifo_or_skip_()
 
 trap_sigpipe_or_skip_()
 {
-  (trap '' PIPE && yes | :) 2>&1 | grep -F 'Broken pipe' >/dev/null ||
+  timeout --version >/dev/null ||
+    skip_ 'trapping SIGPIPE cannot be safely checked'
+
+  (trap '' PIPE && timeout 10 yes |:) 2>&1 | grep 'Broken pipe' >/dev/null ||
     skip_ 'trapping SIGPIPE is not supported'
 }
 
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]