summaryrefslogtreecommitdiff
path: root/tests/help-version
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-03-09 18:03:22 +0000
committerJim Meyering <jim@meyering.net>2001-03-09 18:03:22 +0000
commit115c65d3f466401f9804565f5ed333336e003c63 (patch)
tree6c71df99e1c96fcfb774bcb0b421b49e2200f74e /tests/help-version
parent3bb36380c3cf56e10586aa850ceb4d43ba8dfbc8 (diff)
downloadcoreutils-115c65d3f466401f9804565f5ed333336e003c63.tar.xz
Ensure that /dev/full is a character device
(using test -c) as well as being writable, before trying to write to it. Otherwise, the test could mistakenly append a newline to an existing, regular, writable, /dev/full file. Suggested by Ulrich Drepper.
Diffstat (limited to 'tests/help-version')
-rwxr-xr-xtests/help-version4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/help-version b/tests/help-version
index a30a309f1..d0ae9a4d6 100755
--- a/tests/help-version
+++ b/tests/help-version
@@ -11,7 +11,7 @@ expected_failure_status_sort=2
case "$all_programs" in
*nohup*)
- if test -w /dev/full && echo > /dev/full; then
+ if test -w /dev/full && test -c /dev/full && echo > /dev/full; then
cat 1>&2 <<\EOF
************************************************
WARNING: On this system, the built-in echo function of /bin/sh
@@ -51,7 +51,7 @@ for i in $all_programs; do
./$i --version >/dev/null || fail=1
# Make sure they fail upon `disk full' error.
- if test -w /dev/full; then
+ if test -w /dev/full && test -c /dev/full; then
./$i --help >/dev/full 2>/dev/null && fail=1
./$i --version >/dev/full 2>/dev/null
status=$?