2002-04-17 08:53:50 +00:00
|
|
|
#!/bin/sh
|
2002-04-17 08:54:21 +00:00
|
|
|
# Ensure that touch -c no-such-file no longer fails (it did in 4.1.8).
|
2002-04-17 08:53:50 +00:00
|
|
|
|
2021-01-01 16:36:09 +00:00
|
|
|
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
|
2006-08-17 19:58:17 +00:00
|
|
|
|
2007-07-23 14:35:58 +02:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2006-08-17 19:58:17 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 14:35:58 +02:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
2006-08-17 19:58:17 +00:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-19 01:13:23 -07:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2006-08-17 19:58:17 +00:00
|
|
|
|
2012-09-02 21:55:12 +02:00
|
|
|
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
2015-11-10 14:05:50 +00:00
|
|
|
print_ver_ touch test
|
2002-04-17 08:53:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
2006-06-01 07:10:34 +00:00
|
|
|
|
|
|
|
|
# If >&- works, test "touch -c -" etc.
|
|
|
|
|
# >&- apparently does not work in HP-UX 11.23.
|
|
|
|
|
# This test is ineffective unless /dev/stdout also works.
|
2014-07-01 09:40:50 -07:00
|
|
|
if env test -w /dev/stdout >/dev/null &&
|
|
|
|
|
env test ! -w /dev/stdout >&-; then
|
2006-06-01 07:10:34 +00:00
|
|
|
touch -c - >&- 2> /dev/null || fail=1
|
|
|
|
|
touch -cm - >&- 2> /dev/null || fail=1
|
|
|
|
|
touch -ca - >&- 2> /dev/null || fail=1
|
|
|
|
|
fi
|
2002-04-17 08:53:50 +00:00
|
|
|
|
2008-09-07 10:31:27 +02:00
|
|
|
Exit $fail
|