summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-06-01 07:10:34 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-06-01 07:10:34 +0000
commit8cf6d1850de3579e6894154ae3e9885ce0ec7267 (patch)
tree4d46bd074acbc74c2d2b2b7b5268e84cd1a0f903 /tests
parent42314d3303c9f7e596b738b21a0a2a1f067aa9c8 (diff)
downloadcoreutils-8cf6d1850de3579e6894154ae3e9885ce0ec7267.tar.xz
Don't assume that >&- works.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/touch/no-create-missing13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/touch/no-create-missing b/tests/touch/no-create-missing
index 1faebc81d..781b5a951 100755
--- a/tests/touch/no-create-missing
+++ b/tests/touch/no-create-missing
@@ -25,8 +25,15 @@ fail=0
touch -c no-file > /dev/null 2>&1 || fail=1
touch -cm no-file > /dev/null 2>&1 || fail=1
touch -ca no-file > /dev/null 2>&1 || fail=1
-touch -c - >&- 2> /dev/null || fail=1
-touch -cm - >&- 2> /dev/null || fail=1
-touch -ca - >&- 2> /dev/null || fail=1
+
+# If >&- works, test "touch -c -" etc.
+# >&- apparently does not work in HP-UX 11.23.
+# This test is ineffective unless /dev/stdout also works.
+if $pwd/../../src/test -w /dev/stdout >/dev/null &&
+ $pwd/../../src/test ! -w /dev/stdout >&-; then
+ touch -c - >&- 2> /dev/null || fail=1
+ touch -cm - >&- 2> /dev/null || fail=1
+ touch -ca - >&- 2> /dev/null || fail=1
+fi
(exit $fail); exit $fail