summaryrefslogtreecommitdiff
path: root/tests/misc/nohup.sh
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-11-08 19:57:41 -0600
committerJim Meyering <meyering@fb.com>2016-11-13 17:09:57 -0800
commit4d4d8bccc341941404dc92d0adc057e67014e2ea (patch)
treefaf04706ebd51a3c7e369110fb23bf80b83cef86 /tests/misc/nohup.sh
parenteba871cd3237e8b7dcd9552f544b365934767849 (diff)
downloadcoreutils-4d4d8bccc341941404dc92d0adc057e67014e2ea.tar.xz
tests: use "returns_" rather than explicit comparison with "$?"
The previous "returns_"-using change failed to convert many uses of "$?". Convert all but two of the remaining ones. * tests/ls/stat-vs-dirent.sh: Likewise. * tests/misc/head-write-error.sh: Likewise. * tests/misc/nice.sh: Likewise. * tests/misc/nohup.sh: Likewise. * tests/misc/stdbuf.sh: Likewise. * tests/misc/sync.sh: Likewise. * tests/tail-2/pid.sh: Likewise. * tests/tail-2/wait.sh: Likewise. Thanks to Bernhard Volker for spotting this.
Diffstat (limited to 'tests/misc/nohup.sh')
-rwxr-xr-xtests/misc/nohup.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh
index ad60185b1..e9c8c389a 100755
--- a/tests/misc/nohup.sh
+++ b/tests/misc/nohup.sh
@@ -70,8 +70,7 @@ if test -w /dev/full && test -c /dev/full; then
exec >/dev/tty
test -t 1 || exit 0
- nohup echo hi 2> /dev/full
- test $? = 125 || fail=1
+ returns_ 125 nohup echo hi 2> /dev/full || fail=1
test -f nohup.out || fail=1
compare /dev/null nohup.out || fail=1
rm -f nohup.out
@@ -118,9 +117,7 @@ EOF
# Make sure it fails with exit status of 125 when given too few arguments,
# except that POSIX requires 127 in this case.
-nohup >/dev/null 2>&1
-test $? = 125 || fail=1
-POSIXLY_CORRECT=1 nohup >/dev/null 2>&1
-test $? = 127 || fail=1
+returns_ 125 nohup >/dev/null 2>&1 || fail=1
+POSIXLY_CORRECT=1 returns_ 127 nohup >/dev/null 2>&1 || fail=1
Exit $fail