From: Pádraig Brady Date: Tue, 1 Jul 2025 21:52:16 +0000 (+0100) Subject: tests: cat: add test for O_APPEND bug fix X-Git-Tag: v9.8~252 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8771957703cf4f8d71f2d04ef0614d2aeb0c65ee;p=thirdparty%2Fcoreutils.git tests: cat: add test for O_APPEND bug fix * tests/cat/cat-self.sh: Add a test case for commit v9.6-19-g7386c291b --- diff --git a/tests/cat/cat-self.sh b/tests/cat/cat-self.sh index 3c171b40b2..2d09fc0877 100755 --- a/tests/cat/cat-self.sh +++ b/tests/cat/cat-self.sh @@ -50,4 +50,14 @@ returns_ 1 cat - fx4 fx4 || fail=1 returns_ 1 cat fx5 >>fx5 || fail=1 returns_ 1 cat >fx6 || fail=1 +# coreutils 9.6 would fail with a plain cat if the tty was in append mode +# Simulate with a regular file to simplify +echo foo > file || framework_failure_ +# Set fd 3 at EOF +exec 3< file && cat <&3 > /dev/null || framework_failure_ +# Set fd 4 in append mode +exec 4>> file || framework_failure_ +cat <&3 >&4 || fail=1 +exec 3<&- 4>&- + Exit $fail