1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-28 19:39:52 +02:00

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
This commit is contained in:
Pádraig Brady
2024-08-03 13:37:33 +01:00
parent bead5b05d0
commit 440b40eece
+5
View File
@@ -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