diff options
| author | Pádraig Brady <P@draigBrady.com> | 2024-08-03 13:37:33 +0100 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2024-08-04 10:58:31 +0100 |
| commit | 440b40eecea2e48335247e4670b770ee28eba5e0 (patch) | |
| tree | 6900560d3c4621d0a910a7300595c63264c3d100 /tests/misc/write-errors.sh | |
| parent | doc: reference 'dircolors invocation' from ls --color info (diff) | |
| download | coreutils-440b40eecea2e48335247e4670b770ee28eba5e0.tar.gz coreutils-440b40eecea2e48335247e4670b770ee28eba5e0.zip | |
tests: ensure utils support writing to a closed pipe
* tests/misc/write-errors.sh: A closed pipe is a common scenario,
and should not induce an error. The general case is discussed at:
https://www.pixelbeat.org/programming/sigpipe_handling.html
Diffstat (limited to 'tests/misc/write-errors.sh')
| -rwxr-xr-x | tests/misc/write-errors.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/misc/write-errors.sh b/tests/misc/write-errors.sh index e78d3fdd4..0ead519d6 100755 --- a/tests/misc/write-errors.sh +++ b/tests/misc/write-errors.sh @@ -60,6 +60,11 @@ join all_writers built_programs > built_writers || framework_failure_ while read writer; do timeout 10 $SHELL -c "$writer > /dev/full" test $? = 124 && { fail=1; echo "$writer: failed to exit" >&2; } + + rm -f pipe.err || framework_failure_ + timeout 10 $SHELL -c "$writer 2>pipe.err | :" + { test $? = 0 && compare /dev/null pipe.err; } || + { fail=1; cat pipe.err; echo "$writer: failed to write to closed pipe" >&2; } done < built_writers Exit $fail |
