From 8771957703cf4f8d71f2d04ef0614d2aeb0c65ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Tue, 1 Jul 2025 22:52:16 +0100 Subject: [PATCH] tests: cat: add test for O_APPEND bug fix * tests/cat/cat-self.sh: Add a test case for commit v9.6-19-g7386c291b --- tests/cat/cat-self.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.47.3