From 4d4d8bccc341941404dc92d0adc057e67014e2ea Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@fb.com> Date: Tue, 8 Nov 2016 19:57:41 -0600 Subject: 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. --- tests/ls/stat-vs-dirent.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/ls') diff --git a/tests/ls/stat-vs-dirent.sh b/tests/ls/stat-vs-dirent.sh index b9f3cd1c9..fa2087f53 100755 --- a/tests/ls/stat-vs-dirent.sh +++ b/tests/ls/stat-vs-dirent.sh @@ -23,8 +23,7 @@ print_ver_ ls root_dev_ino=$(stat --format=%d-%i /) t=$(pwd) while :; do - ls -i1 "$t" > tmp - if test $? = 0; then + if ls -i1 "$t" > tmp; then # Extract the inode number from the first line of output from ls -i1. # This value comes from dirent.d_ino, on systems with d_ino support. d_ino=$(sed -n '1s/^ *\([0-9][0-9]*\) .*/\1/p;q' tmp) -- cgit v1.2.3-70-g09d2