diff options
author | Pádraig Brady <P@draigBrady.com> | 2019-01-20 00:13:15 -0800 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2019-01-20 12:53:24 -0800 |
commit | fa50623394f491b975dbd7ad73193519dd721771 (patch) | |
tree | 3455287ba8b09719103d57602161588de26a27ac /init.cfg | |
parent | 17983b2cb3bccbb4fa69691178caddd99269bda9 (diff) | |
download | coreutils-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.cfg | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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_() |