]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Don't assume that >&- works.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Jun 2006 07:10:34 +0000 (07:10 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Jun 2006 07:10:34 +0000 (07:10 +0000)
tests/touch/no-create-missing

index 1faebc81defa978d37a3600de0a0d142c8acc899..781b5a951a11f67c6a2a619e22f9f9923b258b7d 100755 (executable)
@@ -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