]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: dd: avoid false failure with no controlling terminal
authorPádraig Brady <P@draigBrady.com>
Wed, 1 Apr 2026 12:23:54 +0000 (13:23 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 1 Apr 2026 12:31:57 +0000 (13:31 +0100)
* tests/dd/misc.sh: test -w /dev/tty is not a strong enough check,
we need to actually open /dev/tty to ensure it's available.
It's not available under setsid for example.

tests/dd/misc.sh

index e6559bf16865eabdee754b171d645a2e8077ae39..aa776b13794abf8cc772022a3f9a40570f1c7032 100755 (executable)
@@ -125,7 +125,7 @@ compare /dev/null $tmp_out || fail=1
 compare err_ok err || fail=1
 
 # Ensure of=/dev/tty is possible
-if test -c /dev/tty && test -w /dev/tty; then
+if test -c /dev/tty && >/dev/tty; then
   dd if=/dev/null of=/dev/tty || fail=1
 fi