summaryrefslogtreecommitdiff
path: root/init.cfg
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2019-01-20 00:13:15 -0800
committerPádraig Brady <P@draigBrady.com>2019-01-20 12:53:24 -0800
commitfa50623394f491b975dbd7ad73193519dd721771 (patch)
tree3455287ba8b09719103d57602161588de26a27ac /init.cfg
parent17983b2cb3bccbb4fa69691178caddd99269bda9 (diff)
downloadcoreutils-fa50623394f491b975dbd7ad73193519dd721771.tar.gz
tail: fix handling of broken pipes with SIGPIPE ignored
* init.cfg (trap_sigpipe_or_skip_): A new function refactored from... * tests/misc/printf-surprise.sh: ...here. * tests/misc/seq-epipe.sh. Likewise. * src/tail.c (die_pipe): Ensure we exit upon sending SIGPIPE. * tests/tail-2/pipe-f.sh: Ensure we exit even if SIGPIPE is ignored. * NEWS: Mention the bug fix.
Diffstat (limited to 'init.cfg')
-rw-r--r--init.cfg6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.cfg b/init.cfg
index d99a0e3dd..739ba33df 100644
--- a/init.cfg
+++ b/init.cfg
@@ -610,6 +610,12 @@ mkfifo_or_skip_()
fi
}
+trap_sigpipe_or_skip_()
+{
+ (trap '' PIPE && yes | :) 2>&1 | grep -qF 'Broken pipe' ||
+ skip_ 'trapping SIGPIPE is not supported'
+}
+
# Disable the current test if the working directory seems to have
# the setgid bit set.
skip_if_setgid_()