From 5450c7f8d33f7a9ee10a2700cad9ccc6cec3626e Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Tue, 15 Nov 2022 13:57:47 +0000 Subject: [PATCH] tests: make SIGPIPE trap checking more robust * 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 576f6ecd67..856aa2ee7e 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.47.2