]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: tee: avoid false failure due to fifo usage
authorPádraig Brady <P@draigBrady.com>
Thu, 30 Mar 2023 14:49:26 +0000 (15:49 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 31 Mar 2023 10:58:53 +0000 (11:58 +0100)
* tests/misc/tee.sh: Call cleanup_ in all cases to ensure
there are no overlapping interactions on the fifo that
might impact later parts of the test.  This was seen to
cause issue with dash on musl libc.
Addresses https://bugs.gnu.org/62542

tests/misc/tee.sh

index 0b97a9ea3daa7e45dfefc9de63798c80f112b031..444cb688a1305831c1fecf7ef434bc9ccc4a51c2 100755 (executable)
@@ -99,7 +99,7 @@ dd count=20 bs=100K if=/dev/zero status=none |
   dd count=0 oflag=nonblock status=none
   tee || { cleanup_; touch tee.fail; }
 } >fifo
-test -f tee.fail && fail=1
+test -f tee.fail && fail=1 || cleanup_
 
 # Ensure tee honors --output-error modes
 read_fifo() { timeout 10 dd count=1 if=fifo of=/dev/null status=none & }