tests: factor 350 fail=0 initializations into test-lib.sh
authorJim Meyering <meyering@redhat.com>
Fri, 30 Oct 2009 09:50:21 +0000 (10:50 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 30 Oct 2009 11:50:12 +0000 (12:50 +0100)
Run this command to remove the factored-out "fail=0" lines.
perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$')
* tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts.
* tests/...: nearly all bourne shell scripts
Suggested by Eric Blake.

345 files changed:
tests/chgrp/basic
tests/chgrp/default-no-deref
tests/chgrp/deref
tests/chgrp/no-x
tests/chgrp/posix-H
tests/chgrp/recurse
tests/chmod/c-option
tests/chmod/equal-x
tests/chmod/equals
tests/chmod/inaccessible
tests/chmod/no-x
tests/chmod/octal
tests/chmod/setgid
tests/chmod/silent
tests/chmod/thru-dangling
tests/chmod/umask-x
tests/chmod/usage
tests/chown/basic
tests/chown/deref
tests/chown/preserve-root
tests/chown/separator
tests/cp/abuse
tests/cp/acl
tests/cp/backup-1
tests/cp/backup-dir
tests/cp/backup-is-src
tests/cp/cp-HL
tests/cp/cp-a-selinux
tests/cp/cp-deref
tests/cp/cp-i
tests/cp/cp-mv-backup
tests/cp/cp-mv-enotsup-xattr
tests/cp/cp-parents
tests/cp/deref-slink
tests/cp/dir-rm-dest
tests/cp/dir-slash
tests/cp/dir-vs-file
tests/cp/existing-perm-race
tests/cp/fail-perm
tests/cp/into-self
tests/cp/link
tests/cp/link-heap
tests/cp/link-no-deref
tests/cp/link-preserve
tests/cp/no-deref-link1
tests/cp/no-deref-link2
tests/cp/no-deref-link3
tests/cp/parent-perm
tests/cp/parent-perm-race
tests/cp/perm
tests/cp/preserve-2
tests/cp/preserve-gid
tests/cp/preserve-slink-time
tests/cp/proc-short-read
tests/cp/proc-zero-len
tests/cp/r-vs-symlink
tests/cp/reflink-auto
tests/cp/reflink-perm
tests/cp/same-file
tests/cp/slink-2-slink
tests/cp/sparse
tests/cp/special-bits
tests/cp/special-f
tests/cp/src-base-dot
tests/cp/symlink-slash
tests/cp/thru-dangling
tests/dd/direct
tests/dd/misc
tests/dd/not-rewound
tests/dd/reblock
tests/dd/skip-seek-past-dev
tests/dd/skip-seek-past-file
tests/dd/skip-seek2
tests/dd/stderr
tests/dd/unblock-sync
tests/df/total-verify
tests/df/unreadable
tests/du/2g
tests/du/8gb
tests/du/basic
tests/du/deref
tests/du/deref-args
tests/du/exclude
tests/du/fd-leak
tests/du/hard-link
tests/du/inacc-dest
tests/du/inacc-dir
tests/du/inaccessible-cwd
tests/du/long-from-unreadable
tests/du/long-sloop
tests/du/no-deref
tests/du/no-x
tests/du/one-file-system
tests/du/restore-wd
tests/du/slash
tests/du/slink
tests/du/trailing-slash
tests/du/two-args
tests/id/no-context
tests/install/basic-1
tests/install/create-leading
tests/install/d-slashdot
tests/install/install-C
tests/install/install-C-root
tests/install/install-C-selinux
tests/install/strip-program
tests/install/trap
tests/ln/backup-1
tests/ln/hard-backup
tests/ln/hard-to-sym
tests/ln/misc
tests/ln/sf-1
tests/ln/slash-decorated-nonexistent-dest
tests/ln/target-1
tests/ls/abmon-align
tests/ls/capability
tests/ls/color-clear-to-eol
tests/ls/color-dtype-dir
tests/ls/dangle
tests/ls/dired
tests/ls/file-type
tests/ls/follow-slink
tests/ls/infloop
tests/ls/inode
tests/ls/m-option
tests/ls/multihardlink
tests/ls/nameless-uid
tests/ls/no-arg
tests/ls/no-cap
tests/ls/proc-selinux-segfault
tests/ls/readdir-mountpoint-inode
tests/ls/recursive
tests/ls/rt-1
tests/ls/stat-dtype
tests/ls/stat-failed
tests/ls/stat-free-symlinks
tests/ls/stat-vs-dirent
tests/ls/symlink-slash
tests/ls/x-option
tests/misc/arch
tests/misc/cat-buf
tests/misc/cat-proc
tests/misc/chcon
tests/misc/chcon-fail
tests/misc/chroot-credentials
tests/misc/chroot-fail
tests/misc/close-stdout
tests/misc/csplit
tests/misc/date-sec
tests/misc/df-P
tests/misc/env
tests/misc/env-null
tests/misc/false-status
tests/misc/fmt-long-line
tests/misc/groups-dash
tests/misc/groups-version
tests/misc/head-c
tests/misc/head-pos
tests/misc/help-version
tests/misc/id-context
tests/misc/id-groups
tests/misc/ls-time
tests/misc/md5sum-parallel
tests/misc/mknod
tests/misc/nice
tests/misc/nice-fail
tests/misc/nl
tests/misc/nohup
tests/misc/od-N
tests/misc/od-multiple-t
tests/misc/od-x8
tests/misc/pathchk1
tests/misc/printenv
tests/misc/printf
tests/misc/printf-hex
tests/misc/printf-surprise
tests/misc/ptx-overrun
tests/misc/pwd-option
tests/misc/pwd-unreadable-parent
tests/misc/readlink-fp-loop
tests/misc/runcon-no-reorder
tests/misc/selinux
tests/misc/seq-long-double
tests/misc/shred-exact
tests/misc/shred-passes
tests/misc/shred-remove
tests/misc/shuf
tests/misc/sort-compress
tests/misc/sort-continue
tests/misc/sort-merge-fdlimit
tests/misc/sort-rand
tests/misc/sort-version
tests/misc/split-a
tests/misc/split-fail
tests/misc/split-l
tests/misc/stat-fmt
tests/misc/stat-hyphen
tests/misc/stat-slash
tests/misc/stdbuf
tests/misc/stty
tests/misc/stty-invalid
tests/misc/stty-row-col
tests/misc/su-fail
tests/misc/sum-sysv
tests/misc/tac-continue
tests/misc/tee
tests/misc/tee-dash
tests/misc/timeout
tests/misc/timeout-parameters
tests/misc/truncate-dangling-symlink
tests/misc/truncate-fail-diag
tests/misc/truncate-fifo
tests/misc/truncate-no-create-missing
tests/misc/truncate-overflow
tests/misc/truncate-owned-by-other
tests/misc/truncate-parameters
tests/misc/truncate-relative
tests/misc/wc-files0
tests/misc/xattr
tests/mkdir/p-1
tests/mkdir/p-2
tests/mkdir/p-3
tests/mkdir/p-slashdot
tests/mkdir/p-thru-slink
tests/mkdir/p-v
tests/mkdir/parents
tests/mkdir/perm
tests/mkdir/selinux
tests/mkdir/special-1
tests/mkdir/t-slash
tests/mkdir/writable-under-readonly
tests/mv/acl
tests/mv/atomic
tests/mv/atomic2
tests/mv/backup-dir
tests/mv/backup-is-src
tests/mv/childproof
tests/mv/diag
tests/mv/dir-file
tests/mv/dir2dir
tests/mv/dup-source
tests/mv/force
tests/mv/hard-2
tests/mv/hard-3
tests/mv/hard-4
tests/mv/hard-link-1
tests/mv/hard-verbose
tests/mv/i-2
tests/mv/i-3
tests/mv/i-4
tests/mv/i-5
tests/mv/i-link-no
tests/mv/into-self
tests/mv/into-self-2
tests/mv/into-self-3
tests/mv/into-self-4
tests/mv/leak-fd
tests/mv/mv-n
tests/mv/mv-special-1
tests/mv/no-target-dir
tests/mv/part-fail
tests/mv/part-hardlink
tests/mv/part-rename
tests/mv/part-symlink
tests/mv/partition-perm
tests/mv/perm-1
tests/mv/sticky-to-xpart
tests/mv/to-symlink
tests/mv/trailing-slash
tests/mv/update
tests/readlink/can-e
tests/readlink/can-f
tests/readlink/can-m
tests/readlink/rl-1
tests/rm/cycle
tests/rm/dangling-symlink
tests/rm/deep-1
tests/rm/deep-2
tests/rm/dir-no-w
tests/rm/dir-nonrecur
tests/rm/dot-rel
tests/rm/empty-inacc
tests/rm/ext3-perf
tests/rm/f-1
tests/rm/fail-2eperm
tests/rm/fail-eacces
tests/rm/hash
tests/rm/i-1
tests/rm/i-never
tests/rm/i-no-r
tests/rm/ignorable
tests/rm/inaccessible
tests/rm/interactive-always
tests/rm/interactive-once
tests/rm/ir-1
tests/rm/isatty
tests/rm/no-give-up
tests/rm/one-file-system
tests/rm/r-1
tests/rm/r-2
tests/rm/r-3
tests/rm/r-4
tests/rm/readdir-bug
tests/rm/rm1
tests/rm/rm2
tests/rm/rm3
tests/rm/rm4
tests/rm/rm5
tests/rm/sunos-1
tests/rm/unread2
tests/rm/unread3
tests/rm/v-slash
tests/rmdir/fail-perm
tests/rmdir/ignore
tests/rmdir/t-slash
tests/sample-test
tests/tail-2/append-only
tests/tail-2/big-4gb
tests/tail-2/flush-initial
tests/tail-2/follow-stdin
tests/tail-2/infloop-1
tests/tail-2/inotify-race
tests/tail-2/pid
tests/tail-2/pipe-f
tests/tail-2/pipe-f2
tests/tail-2/proc-ksyms
tests/tail-2/start-middle
tests/tail-2/tail-n0f
tests/tail-2/wait
tests/test-lib.sh
tests/touch/60-seconds
tests/touch/dangling-symlink
tests/touch/dir-1
tests/touch/empty-file
tests/touch/fail-diag
tests/touch/fifo
tests/touch/no-create-missing
tests/touch/no-dereference
tests/touch/no-rights
tests/touch/not-owner
tests/touch/now-owned-by-other
tests/touch/obsolescent
tests/touch/read-only
tests/touch/relative
tests/touch/trailing-slash

index 2c0d7fa..4fad176 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 require_membership_in_two_groups_
 
-fail=0
 
 set _ $groups; shift
 g1=$1
index fc378de..dc7e9d0 100755 (executable)
@@ -29,7 +29,6 @@ g2=$2
 
 mkdir d && touch f && ln -s ../f d/s || framework_failure
 
-fail=0
 
 g_init=`stat --printf=%g f`
 chgrp -R $g2 d || fail=1
index d4f19ce..1a20e05 100755 (executable)
@@ -38,7 +38,6 @@ test "$g" = $g2 ||
   skip_test_ "your system doesn't support changing the owner or group" \
       "of a symbolic link."
 
-fail=0
 
 chgrp $g1 f
 set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
index 3ec49e9..175c1b2 100755 (executable)
@@ -33,7 +33,6 @@ g2=$2
 mkdir -p d/no-x/y || framework_failure
 chmod u=rw d/no-x || framework_failure
 
-fail=0
 
 # This must exit nonzero.
 chgrp -R $g2 d >/dev/null 2>out && fail=1
index c24aa3f..87295d4 100755 (executable)
@@ -34,7 +34,6 @@ ln -s 1 1s || framework_failure
 ln -s ../3 2/2s || framework_failure
 chgrp -R $g1 1 2 3 || framework_failure
 
-fail=0
 
 chgrp --preserve-root -H -R $g2 1s 2 || fail=1
 
index d29a651..b0f2e27 100755 (executable)
@@ -28,7 +28,6 @@ set _ $groups; shift
 g1=$1
 g2=$2
 
-fail=0
 
 # chgrp -R should not traverse a symlink to a directory.
 mkdir d e
index 8d5979a..f00ef4b 100755 (executable)
@@ -30,7 +30,6 @@ chmod 444 $file || framework_failure
 
 skip_if_setgid_
 
-fail=0
 
 chmod u=rwx $file || fail=1
 chmod -c g=rwx $file > out || fail=1
index 97823e0..d74dcc3 100755 (executable)
@@ -26,7 +26,6 @@ fi
 file=f
 touch $file || framework_failure
 
-fail=0
 umask 005
 for mode in =x =xX =Xx =x,=X =X,=x; do
   chmod a=r,$mode $file || fail=1
index fc0243c..71c2b7d 100755 (executable)
@@ -27,7 +27,6 @@ fi
 
 touch f || framework_failure
 
-fail=0
 
 expected_u=-rwx------
 expected_g=----rwx---
index d0d739e..2ee6c01 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir -p d/e || framework_failure
 chmod 0 d/e d || framework_failure
 
-fail=0
 
 chmod u+rwx d d/e || fail=1
 
index 24cc01e..82aeb5f 100755 (executable)
@@ -28,7 +28,6 @@ skip_if_root_
 mkdir -p d/no-x/y a/b || framework_failure
 chmod u=rw d/no-x || framework_failure
 
-fail=0
 
 # This must exit nonzero.
 chmod -R o=r d >/dev/null 2>out && fail=1
index 36423cb..044cf3c 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # Before coreutils-5.92, this would mistakenly succeed,
 # and act like `chmod 0 .'.
index 5fe74ee..4b117f8 100755 (executable)
@@ -44,7 +44,6 @@ chmod g+s d 2> /dev/null && env -- test -g d ||
 env -- test -g d ||
   skip_test_ 'cannot create setgid directories'
 
-fail=0
 
 chmod 755 d
 
index e0e9846..9f2d08e 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 chmod -f 0   no-such 2> out && fail=1
 chgrp -f 0   no-such 2>> out && fail=1
 chown -f 0:0 no-such 2>> out && fail=1
index 6ecf643..6a77427 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 ln -s non-existent dangle || framework_failure
 
-fail=0
 
 # This operation cannot succeed since the symbolic link dangles.
 chmod 644 dangle 2> out && fail=1
index 32d815b..ae0e51c 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 touch file
 chmod 755 file
 (umask 77 && chmod -x file) 2>/dev/null && fail=1
index 1f18944..9dd90ad 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # Each line in this list is a set of arguments, followed by :,
 # followed by the set of files it will attempt to chmod,
index 6708da0..95a9cd1 100755 (executable)
@@ -26,7 +26,6 @@ require_root_
 
 touch f || framework_failure
 
-fail=0
 chown -R --preserve-root 0:1 f
 
 # Make sure the owner and group are 0 and 1 respectively.
index 24d0f93..c609751 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 ln -s no-such dangle || framework_failure
 
-fail=0
 
 set _ `ls -ldo dangle`; shift; user=$3
 
index d332620..f5c4fce 100755 (executable)
@@ -26,7 +26,6 @@ skip_if_root_
 
 mkdir d && ln -s / d/slink-to-root
 
-fail=0
 
 # Even if --preserve-root were to malfunction, allowing the chown or
 # chgrp to traverse through "/", since we're running as non-root,
index 4ee2856..6e717f6 100755 (executable)
@@ -46,7 +46,6 @@ case $host_triplet in
   *) ;;
 esac
 
-fail=0
 
 chown '' . || fail=1
 
index e9086b8..42f6692 100755 (executable)
@@ -32,7 +32,6 @@ echo "cp: will not copy \`b/1' through just-created symlink \`c/1'" \
 
 # Check both cases: a dangling symlink, and one pointing to a writable file.
 
-fail=0
 for i in dangling-dest existing-dest; do
   test $i = existing-dest && echo i > t
   test $i = dangling-dest && rm -f t
index 059a1e1..2f87428 100755 (executable)
@@ -45,7 +45,6 @@ acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \
 test $skip = yes &&
   skip_test_ "'.' is not on a suitable file system for this test"
 
-fail=0
 # copy a file without preserving permissions
 cp a/file b/ || fail=1
 
index cc19f93..7374595 100755 (executable)
@@ -29,7 +29,6 @@ file_backup="$file$suffix"
 temp_files="$file $file_backup"
 rm -f $temp_files
 
-fail=0
 echo test > $file || fail=1
 
 # Specify both version control and suffix so the environment variables
index 9f0d0d7..a82d213 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkdir x y || framework_failure
 
-fail=0
 
 cp -a x y || fail=1
 
index f226382..bf03e59 100755 (executable)
@@ -26,7 +26,6 @@ fi
 echo a > a || framework_failure
 echo a-tilde > a~ || framework_failure
 
-fail=0
 # This cp command should exit nonzero.
 cp --b=simple a~ a > out 2>&1 && fail=1
 
index 17fff79..88f10e9 100755 (executable)
@@ -28,7 +28,6 @@ echo f > f || framework_failure
 ln -s f slink || framework_failure
 ln -s no-such-file src-dir/slink || framework_failure
 
-fail=0
 
 cp -H -R slink src-dir dest-dir || fail=1
 test -d src-dir || fail=1
index b1359c0..82bf4ae 100755 (executable)
@@ -59,7 +59,6 @@ cd mnt                                       || framework_failure
 echo > f                                     || framework_failure
 echo > g                                     || framework_failure
 
-fail=0
 
 # /bin/cp from coreutils-6.7-3.fc7 would fail this test by letting cp
 # succeed (giving no diagnostics), yet leaving the destination file empty.
index 5868fa2..3e3dab4 100755 (executable)
@@ -28,7 +28,6 @@ mkdir a b c d || framework_failure
 ln -s ../c a || framework_failure
 ln -s ../c b || framework_failure
 
-fail=0
 
 # Before coreutils-5.94, the following would fail with this message:
 # cp: will not create hard link `d/b/c' to directory `d/a/c'
index 67f8a56..59f60dd 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir -p a b/a/c || framework_failure
 touch a/c || framework_failure
 
-fail=0
 
 # coreutils 6.2 cp would neglect to prompt in this case.
 echo n | cp -iR a b 2>/dev/null || fail=1
index 59d03a3..c43734e 100755 (executable)
@@ -36,7 +36,6 @@ expected=expected
 
 exec 1> $actual
 
-fail=0
 for prog in cp mv; do
   for initial_files in 'x' 'x y' 'x y y~' 'x y y.~1~' 'x y y~ y.~1~'; do
     for opt in none off  numbered t  existing nil  simple never; do
index 8f3020b..620560b 100755 (executable)
@@ -59,7 +59,6 @@ getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_a >/dev/null \
   || skip_test_ "failed to set xattr of file"
 
-fail=0
 
 # This should pass without diagnostics
 cp -a a mnt/ 2>err  || fail=1
index da04c45..1ba585f 100755 (executable)
@@ -34,7 +34,6 @@ mkdir -p a/b/c d e g || framework_failure
 ln -s d/a sym || framework_failure
 touch f || framework_failure
 
-fail=0
 
 # With 4.0.37 and earlier (back to when?), this would fail
 # with the failed assertion from dirname.c.
index d37cb11..0a8872d 100755 (executable)
@@ -27,7 +27,6 @@ fi
 touch f slink-target || framework_failure
 ln -s slink-target slink || framework_failure
 
-fail=0
 cp -d f slink || fail=1
 
 Exit $fail
index c5429d7..aecc41b 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkdir d e || framework_failure
 
-fail=0
 # Do it once with no destination...
 cp -R --remove-destination d e || fail=1
 
index 0c1e282..df41c17 100755 (executable)
@@ -27,7 +27,6 @@ fi
 mkdir dir1 dir2 || framework_failure
 touch dir1/file || framework_failure
 
-fail=0
 cp -R dir1/ dir2 || fail=1
 
 # This file should not exist, but it did with fileutils-4.0w.
index 7e5e9d0..341536a 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir dir || framework_failure
 touch file || framework_failure
 
-fail=0
 
 # In 4.0.35, this cp invocation silently succeeded.
 cp -R dir file 2>/dev/null && fail=1
index e7166a7..0299e1e 100755 (executable)
@@ -28,7 +28,6 @@ set _ $groups; shift
 g1=$1
 g2=$2
 
-fail=0
 
 umask 077
 mkfifo fifo ||
index f470665..0a4b253 100755 (executable)
@@ -29,7 +29,6 @@ touch D/a || framework_failure
 chmod 0 D/a || framework_failure
 chmod u=rx,go=,-st D || framework_failure
 
-fail=0
 
 # This is expected to exit non-zero, because it can't read D/a.
 cp -pR D DD > /dev/null 2>&1 && fail=1
index cd87232..84a0096 100755 (executable)
@@ -30,7 +30,6 @@ fi
 
 mkdir a dir || framework_failure
 
-fail=0
 
 # This command should exit nonzero.
 cp -R dir dir 2> out && fail=1
index d9cf4f8..416e64e 100755 (executable)
@@ -28,7 +28,6 @@ touch src || framework_failure
 touch dest || framework_failure
 touch dest2 || framework_failure
 
-fail=0
 
 cp -f --link src dest || fail=1
 cp -f --symbolic-link src dest2 || fail=1
index d9379b5..c0f36bf 100755 (executable)
@@ -35,7 +35,6 @@ cp -al $a $b || framework_failure
 mkdir e || framework_failure
 mv $a $b e || framework_failure
 
-fail=0
 (ulimit -v 20000; cp -al e f) || fail=1
 
 Exit $fail
index d71a114..aa57067 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 ln -s no-such-file dangling-slink || framework_failure
 
-fail=0
 
 # Prior to coreutils-6.0, this would fail on non-Linux kernels,
 # with link being applied to the dangling symlink.
index fcaef2d..b07a9d9 100755 (executable)
@@ -31,7 +31,6 @@ cp -d a b c || framework_failure
 test -f c/a || framework_failure
 test -f c/b || framework_failure
 
-fail=0
 
 a_inode=`ls -i c/a|sed 's,c/.*,,'`
 b_inode=`ls -i c/b|sed 's,c/.*,,'`
index 86164ec..a362471 100755 (executable)
@@ -30,7 +30,6 @@ cd b
 ln -s ../a/foo .
 cd ..
 
-fail=0
 
 # It should fail with a message something like this:
 #   ./cp: `a/foo' and `b/foo' are the same file
index f323d6b..1f70bec 100755 (executable)
@@ -30,7 +30,6 @@ cd b
 ln -s ../a .
 cd ..
 
-fail=0
 
 # It should fail with a message something like this:
 #   cp: `a' and `b/foo' are the same file
index 353e3ce..c1af544 100755 (executable)
@@ -27,7 +27,6 @@ msg=bar
 echo $msg > a
 ln -s a b
 
-fail=0
 
 # It should fail with a message something like this:
 #   cp: `a' and `b' are the same file
index fe13041..5da5ea7 100755 (executable)
@@ -34,7 +34,6 @@ cp -p --parent a/b/c/foo e || framework_failure
 # to a destination directory that it doesn't create.
 chmod g-rx e/a e/a/b || framework_failure
 
-fail=0
 cp -p --parent a/b/d/foo e || fail=1
 
 # Ensure that permissions on just-created directory, e/a/,
index 186e7b2..674824b 100755 (executable)
@@ -27,7 +27,6 @@ umask 002
 mkdir mode ownership d || framework_failure
 chmod g+s d 2>/dev/null # The cp test is valid either way.
 
-fail=0
 
 for attr in mode ownership
 do
index 7cc6f41..0f15725 100755 (executable)
@@ -27,7 +27,6 @@ very_expensive_
 
 umask 037
 
-fail=0
 
 # Now, try it with `mv', with combinations of --force, no-f and
 # existing-destination and not.
index f2739a3..9549fd1 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 touch f || framework_failure
 
-fail=0
 
 cp --preserve=mode,links f g || fail=1
 
index 1f3f10b..5b932af 100755 (executable)
@@ -102,5 +102,4 @@ t1 b1 "$nameless_uid" "$nameless_gid2" cp -p
 t1 c0 "$nameless_uid" "$nameless_gid1" cp -p
 t1 c1 "$nameless_uid" "$nameless_gid2" cp -p
 
-fail=0
 Exit $fail
index 407b772..f9afc86 100755 (executable)
@@ -40,7 +40,6 @@ cp -Pp dangle d2 || framework_failure
 stat --format=%y dangle > t1 || framework_failure
 stat --format=%y d2 > t2 || framework_failure
 
-fail=0
 compare t1 t2 || fail=1
 
 Exit $fail
index e06143c..93e21bd 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 kall=/proc/kallsyms
 
 test -r $kall || skip_test_ "your system lacks $kall"
index 9103d8a..f71db61 100755 (executable)
@@ -28,7 +28,6 @@ touch empty || framework_failure
 f=/proc/cpuinfo
 test -r $f || f=empty
 
-fail=0
 cat $f > out || fail=1
 
 # With coreutils-6.9, this would create a zero-length "exp" file.
index 4b4e635..b88dc1e 100755 (executable)
@@ -31,7 +31,6 @@ echo abc > foo || framework_failure
 ln -s foo slink || framework_failure
 ln -s no-such-file no-file || framework_failure
 
-fail=0
 
 # This would fail in 4.1.5, not in 4.1.6.
 cp -r no-file junk 2>/dev/null || fail=1
index 5e39b72..949acb4 100755 (executable)
@@ -30,7 +30,6 @@ rm -f "$a_other" || framework_failure
 
 echo non_zero_size > "$a_other" || framework_failure
 
-fail=0
 # we shouldn't be able to reflink() files on separate partitions
 cp --reflink      "$a_other" b && fail=1
 
index 0c75246..7e4c907 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 : > time_check
 : > file
index d5deb68..79b599a 100755 (executable)
@@ -220,7 +220,6 @@ cat <<\EOF | sed "$remove_these_sed" > $expected
 
 EOF
 
-fail=0
 
 compare $expected $actual 1>&2 || fail=1
 
index ed755bc..1225af2 100755 (executable)
@@ -30,7 +30,6 @@ ln -s file b || framework_failure
 ln -s no-such-file c || framework_failure
 ln -s no-such-file d || framework_failure
 
-fail=0
 cp --update --no-dereference a b || fail=1
 cp --update --no-dereference c d || fail=1
 
index 9683a9e..cb1734b 100755 (executable)
@@ -31,7 +31,6 @@ require_sparse_support_
 size=`expr 128 \* 1024 + 1`
 dd bs=1 seek=$size of=sparse < /dev/null 2> /dev/null || framework_failure
 
-fail=0
 
 cp --sparse=always sparse copy || fail=1
 
index eaacd14..d7829f3 100755 (executable)
@@ -35,7 +35,6 @@ chmod a=r,ug+sx c || framework_failure
 chown $NON_ROOT_USERNAME . || framework_failure
 chmod u=rwx,g=rx,o=rx . || framework_failure
 
-fail=0
 
 cp -p a a2 || fail=1
 set _ `ls -l a`; shift; p1=$1
index c2641db..65816a1 100755 (executable)
@@ -28,7 +28,6 @@ mkfifo fifo ||
   skip_test_ "fifos not supported"
 touch e || framework-failure
 
-fail=0
 
 # Without -f, expect it to fail.
 cp -R fifo e || fail=1
index 1b0ee7a..6ed9c26 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkdir x y || framework_failure
 
-fail=0
 
 cd y
 cp --verbose -ab ../x/. . > out 2>&1 || fail=1
index a821e7e..1e4e94c 100755 (executable)
@@ -27,7 +27,6 @@ fi
 mkdir dir || framework_failure
 ln -s dir symlink || framework_failure
 
-fail=0
 cp -dR symlink/ s || fail=1
 set `ls -l s`
 
index b2a5d74..6331839 100755 (executable)
@@ -29,7 +29,6 @@ echo hi > exp || framework_failure
 echo "cp: not writing through dangling symlink \`dangle'" \
     > exp-err || framework_failure
 
-fail=0
 
 # Starting with 6.9.90, this usage fails, by default:
 cp f dangle > err 2>&1 && fail=1
index 7e80bee..05c487f 100755 (executable)
@@ -31,7 +31,6 @@ truncate -s 511 short || framework_failure
 truncate -s 8191 m1 || framework_failure
 truncate -s 8193 p1 || framework_failure
 
-fail=0
 for i in short m1 p1; do
   rm -f out
   dd if=$i oflag=direct of=out || fail=1
index 07a019a..53562d1 100755 (executable)
@@ -29,7 +29,6 @@ tmp_in2=dd-in2.$$
 tmp_sym=dd-sym.$$
 tmp_out=dd-out.$$
 
-fail=0
 warn=0
 echo data > $tmp_in || framework_failure
 ln $tmp_in $tmp_in2 || framework_failure
index 056d961..101e375 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 echo abcde > in
 (dd skip=1 count=1 bs=1; dd skip=1 bs=1) < in > out 2> /dev/null || fail=1
index 5d6e95b..244345a 100755 (executable)
@@ -37,7 +37,6 @@ cat <<\EOF > exp-no-reblock || framework_failure
 4 bytes (4 B) copied
 EOF
 
-fail=0
 
 # Use a fifo rather than a pipe in the tests below
 # so that the producer (printf subshell) will wait
index c9abfc0..f11542a 100755 (executable)
@@ -33,7 +33,6 @@ get_device_size() {
   $BLOCKDEV --getsize64 "$1"
 }
 
-fail=0
 
 # Get path to device the current dir is on.
 # Note df can only get fs size, not device size.
index 937f99e..6bbf505 100755 (executable)
@@ -25,7 +25,6 @@ fi
 require_sparse_support_ # for `truncate --size=$OFF_T_MAX`
 eval $(getlimits) # for OFF_T limits
 
-fail=0
 
 printf "1234" > file || framework_failure
 
index 8bf0c85..ce57b6b 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 echo LA:3456789abcdef > in || fail=1
 (dd bs=1 skip=3 count=0 && dd bs=5) < in > out 2> /dev/null || fail=1
index a6c8fba..5c903c8 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 p=$abs_top_builddir
 
-fail=0
 
 # Ensure this exits successfully, even though stderr is closed,
 # because it generates no stderr output.
index 4112e0e..4b213c1 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 printf 000100020003xx > in || framework_failure
 
-fail=0
 
 dd cbs=4 ibs=4 conv=unblock,sync < in > out 2> /dev/null || fail=1
 cat <<\EOF > exp || fail=1
index 7b6273d..dbedb87 100755 (executable)
@@ -61,7 +61,6 @@ cat space  # this helps when debugging any test failure
 df --total -i -P               > inode || framework_failure
 cat inode
 
-fail=0
 $PERL check-df space || fail=1
 $PERL check-df inode || fail=1
 
index 8e60028..d5df537 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 skip_if_root_
 
-fail=0
 touch unreadable || fail=1
 chmod a-r unreadable || fail=1
 df unreadable || fail=1
index 4981efb..4dc9fe0 100755 (executable)
@@ -28,7 +28,6 @@ fi
 # Creating a 2GB file counts as `very expensive'.
 very_expensive_
 
-fail=0
 
 # Get number of free kilobytes on current partition, so we can
 # skip this test if there is insufficient free space.
index 1812d16..a9779c6 100755 (executable)
@@ -44,7 +44,6 @@ possibly because this system's NFS support is buggy
 Consider rerunning this test on a different file system."
 fi
 
-fail=0
 
 # This would print `0  big' with coreutils-4.5.8.
 du -ab big > out || fail=1
index 5714e57..38253bd 100755 (executable)
@@ -32,7 +32,6 @@ printf '%*s' 257 make-sure-the-file-is-non-empty > a/b/F || framework_failure
 printf %4096s x > d/1
 cp d/1 d/sub/2
 
-fail=0
 
 B=`stat --format=%B a/b/F`
 
index cb23cc1..3d7fe03 100755 (executable)
@@ -28,7 +28,6 @@ mkdir -p a/sub || framework_failure
 ln -s a/sub slink || framework_failure
 touch b || framework_failure
 
-fail=0
 
 # This used to fail with the following diagnostic:
 # du: `b': No such file or directory
index ce02807..7ed7d40 100755 (executable)
@@ -29,7 +29,6 @@ ln -s dir slink || framework_failure
 printf %65536s x > 64k || framework_failure
 ln -s 64k slink-to-64k || framework_failure
 
-fail=0
 
 du -D slink | sed 's/^[0-9][0-9]*      //' > out
 # Ensure that the trailing slash is preserved and handled properly.
index 15dd9a6..12c1ef4 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkdir -p a/b/c a/x/y a/u/v || framework_failure
 
-fail=0
 
 du --exclude=x a | sed 's/^[0-9][0-9]* //' | sort > out || fail=1
 printf '===\n' >> out
index c280b88..fd53f1f 100755 (executable)
@@ -40,7 +40,6 @@ done
 # This may fail due to command line limitations.
 touch $f || framework_failure
 
-fail=0
 
 # With coreutils-5.0, this would fail due to a file descriptor leak.
 du $f > out || fail=1
index d9dd247..fe4ae19 100755 (executable)
@@ -28,7 +28,6 @@ fi
 mkdir -p dir/sub
 ( cd dir && { echo non-empty > f1; ln f1 f2; echo non-empty > sub/F; } )
 
-fail=0
 
 # Note that for this first test, we transform f1 or f2
 # (whichever name we find first) to f_.  That is necessary because,
index 3373195..fe65fca 100755 (executable)
@@ -28,7 +28,6 @@ skip_if_root_
 mkdir f && cd f && mkdir a b c d e && touch c/j && chmod a-x c \
     || framework_failure
 
-fail=0
 du > ../t 2>&1 && fail=1
 
 # Accept either of the following outputs.
index 030a40a..dde7903 100755 (executable)
@@ -25,7 +25,6 @@ skip_if_root_
 
 mkdir -p a/sub || framework_failure
 
-fail=0
 
 du -s a > exp || fail=1
 chmod 0 a/sub || fail=1
index 05f9b2f..0f36b0c 100755 (executable)
@@ -33,7 +33,6 @@ mkdir -p no-x a/b || framework_failure
 cd no-x || framework_failure
 chmod 0 . || framework_failure
 
-fail=0
 
 du "$cwd/a" > /dev/null || fail=1
 
index 68ec613..c87d3b5 100755 (executable)
@@ -65,7 +65,6 @@ mkdir inaccessible || framework_failure
 cd inaccessible || framework_failure
 chmod 0 . || framework_failure
 
-fail=0
 du -s "$cwd/$dir" > /dev/null || fail=1
 
 Exit $fail
index f624419..99f7a15 100755 (executable)
@@ -62,7 +62,6 @@ cat $file > /dev/null 2> err &&
 in file name resolution'
 too_many=`sed 's/.*: //' err`
 
-fail=0
 
 # With coreutils-5.93 there was no failure.
 # With coreutils-5.94 we get the desired diagnostic:
index 9ea8df3..9b29270 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir -p dir/a/b || framework_failure
 ln -s dir slink || framework_failure
 
-fail=0
 
 du slink | sed 's/^[0-9][0-9]* //' > out
 cat <<\EOF > exp
index 986689a..3d24572 100755 (executable)
@@ -28,7 +28,6 @@ skip_if_root_
 mkdir -p d/no-x/y || framework_failure
 chmod u=rw d/no-x || framework_failure
 
-fail=0
 
 # This must exit nonzero.
 du d >/dev/null 2>out && fail=1
index 0f95fe9..1d395c4 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 mkdir -p b/c y/z || framework_failure
 
-fail=0
 
 # Due to a used-uninitialized variable, the "du -x" from coreutils-6.6
 # would not traverse into second and subsequent directories listed
index cbe147a..fcaf1f3 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 mkdir a b || framework_failure
 
-fail=0
 
 # With du from coreutils-4.5.5 and 4.5.6, this would fail with
 # du: `b': No such file or directory
index aac1718..826a70f 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 require_readable_root_
 
-fail=0
 
 du --exclude='[^/]*' -x / > out-t || fail=1
 sed 's/^[0-9][0-9]*    //' out-t > out
index 3653067..45bd17e 100755 (executable)
@@ -45,7 +45,6 @@ if df --type=nfsv3 . >/dev/null 2>&1; then
   skip_test_ "\`.' is on an NFS file system"
 fi
 
-fail=0
 symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
 for len in $symlink_name_lengths; do
   name=`seq 1 $len|tr -c x y |head -c$len`
index 997bc05..1024463 100755 (executable)
@@ -29,7 +29,6 @@ fi
 mkdir -p dir/1/2 || framework_failure
 ln -s dir slink || framework_failure
 
-fail=0
 
 du slink/ | sed 's/^[0-9][0-9]*        //' > out
 echo === >> out
index f59ca73..e5ddb2b 100755 (executable)
@@ -33,7 +33,6 @@ cd sub || framework_failure
 t=t
 mkdir -p $t/1 $t/2 || framework_failure
 
-fail=0
 test -d $t || fail=1
 du $t/1 $t/2 > /dev/null || fail=1
 
index f875ee0..0e42e3a 100755 (executable)
@@ -27,7 +27,6 @@ fi
 # but this is as good a witness as any, in general.
 require_selinux_
 
-fail=0
 
 # Require the context=... part by default.
 id > out || fail=1
index 7fdb739..a09be63 100755 (executable)
@@ -31,7 +31,6 @@ rm -rf $dir $file || framework_failure
 mkdir -p $dir || framework_failure
 echo foo > $file || framework_failure
 
-fail=0
 ginstall $file $dir || fail=1
 # Make sure the source file still exists.
 test -f $file || fail=1
index 0740ca5..012f0a0 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 file=file
 echo foo > $file
index 632fef5..95ed038 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 ginstall -d d1/. || fail=1
 test -d d1 || fail=1
index a1a9d68..1edfa54 100755 (executable)
@@ -28,7 +28,6 @@ mode1=0644
 mode2=0755
 mode3=2755
 
-fail=0
 
 echo test > a || framework_failure
 echo "\`a' -> \`b'" > out_installed_first || framework_failure
index 234ebe7..b31d29d 100755 (executable)
@@ -30,7 +30,6 @@ u2=2
 g1=1
 g2=2
 
-fail=0
 
 echo test > a || framework_failure
 echo "\`a' -> \`b'" > out_installed_first
index a91d8bb..95aacda 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 require_selinux_
 
-fail=0
 
 echo test > a || framework_failure
 chcon -u system_u a || skip_test_ "chcon doesn't work"
index 88072cc..d96d0d3 100755 (executable)
@@ -31,7 +31,6 @@ sed s/b/B/ \$1 > \$1.t && mv \$1.t \$1
 EOF
 chmod a+x b || framework_failure
 
-fail=0
 
 echo abc > src || fail=1
 echo aBc > exp || fail=1
index 37da21f..157bb6a 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
 (
index 68c9ca2..cc3e10e 100755 (executable)
@@ -28,7 +28,6 @@ fi
 
 touch a b || framework_failure
 
-fail=0
 ln b b~ || fail=1
 ln -f --b=simple a b || fail=1
 
index 54bf9eb..6ff0b95 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 touch f || framework_failure
 
-fail=0
 
 ln --backup f f 2> out && fail=1
 cat <<\EOF > exp || fail=1
index 510b57a..22b5923 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # ===================================================
 # ensure -s silently overrides -L, -P
index d42d68a..d2c8e3e 100755 (executable)
@@ -27,7 +27,6 @@ t=tln-symlink
 d=tln-subdir
 ld=tln-symlink-to-subdir
 f=tln-file
-fail=0
 
 # Create a simple symlink with both source and destination files
 # in current directory.
index bc189fd..df9e233 100755 (executable)
@@ -27,7 +27,6 @@ fi
 echo foo > a || framework_failure
 ln -s . b || framework_failure
 
-fail=0
 ln -sf a b > err 2>&1 && fail=1
 case `cat err` in
   *'are the same file') ;;
index afbbd06..2237e30 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 touch f || framework_failure
 
-fail=0
 
 # Before coreutils-7.6, this would succeed on Solaris 10
 ln -T f no-such-file/ && fail=1
index 5496db7..f681d51 100755 (executable)
@@ -29,7 +29,6 @@ fi
 . $srcdir/test-lib.sh
 
 mkdir d || framework_failure
-fail=0
 ln -s --target-dir=d ../f || fail=1
 
 Exit $fail
index 47df97a..51c32ab 100755 (executable)
@@ -27,7 +27,6 @@ for mon in $(seq -w 12); do
     touch -d"+$mon month" $mon.ts || framework_failure
 done
 
-fail=0
 
 # Note some of the following locales may be missing but if so
 # we should fail back to the C locale which should be aligned
index c45f542..958a8dd 100755 (executable)
@@ -29,7 +29,6 @@ grep '^#define HAVE_CAP 1$' $CONFIG_HEADER > /dev/null \
 
 (setcap --help) 2>&1 |grep 'usage: setcap' > /dev/null \
   || skip_test_ "setcap utility not found"
-fail=0
 
 # Don't let a different umask perturb the results.
 umask 22
index fd65ced..aa8cf4e 100755 (executable)
@@ -32,7 +32,6 @@ c_pre="$e[0m$e[${color_code}m"
 c_post="$e[0m$e[K\n$e[m"
 printf "$c_pre$long_name$c_post\n" > exp || framework_failure
 
-fail=0
 env TERM=xterm COLUMNS=80 LS_COLORS="*.foo=$color_code" TIME_STYLE=+T \
   ls -og --color=always $long_name > out || fail=1
 
index 3ccf10e..526d9e9 100755 (executable)
@@ -33,7 +33,6 @@ mkdir d other-writable sticky || framework_failure
 chmod o+w other-writable || framework_failure
 chmod o+t sticky || framework_failure
 
-fail=0
 
 ls --color=always > out || fail=1
 cat -A out > o1 || fail=1
index 687d3df..1f4ca26 100755 (executable)
@@ -31,7 +31,6 @@ ln -s no-such d/dangle || framework_failure
 printf '? dangle\n' > subdir_Li_exp || framework_failure
 printf 'total 0\n? dangle\n' > subdir_Ls_exp || framework_failure
 
-fail=0
 
 # This must exit nonzero.
 ls -L dangle > /dev/null 2>&1 && fail=1
index a2a2ded..b4607e1 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkdir dir || framework_failure
 
-fail=0
 
 LC_MESSAGES=C ls -lR --dired dir > out || fail=1
 cat <<EOF > exp
index d4b240f..60db1d0 100755 (executable)
@@ -39,7 +39,6 @@ mkfifo fifo
 cd ..
 
 
-fail=0
 
 ls -F sub > out || fail=1
 cat <<EOF > exp
index 27b2a1c..ba2df3f 100755 (executable)
@@ -34,7 +34,6 @@ ln -s ../../dir1 sub/link-to-dir || framework_failure
 # systems running some DJGPP-2.03 libc.
 ls -F link > /dev/null || framework_failure
 
-fail=0
 
 # When explicitly listing a broken link, the command must fail.
 ls -L link 2> /dev/null && fail=1
index b77f88c..d32e978 100755 (executable)
@@ -36,7 +36,6 @@ cat <<\EOF > exp-err || framework_failure
 ls: loop/sub: not listing already-listed directory
 EOF
 
-fail=0
 
 timeout 1 ls -RL loop 2>err > out
 # Ensure that ls exits with status 2 upon detecting a cycle
index f911984..58130e2 100755 (executable)
@@ -26,7 +26,6 @@ fi
 touch f || framework_failure
 ln -s f slink || framework_failure
 
-fail=0
 
 # When listed explicitly:
 
index 836d50e..1c2c291 100755 (executable)
@@ -26,7 +26,6 @@ fi
 seq 2000 > b || framework_failure
 touch a || framework_failure
 
-fail=0
 
 # Before coreutils-5.1.1, the following would output a space after the comma.
 ls -w2 -m a b > out || fail=1
index 815222d..cbe6330 100755 (executable)
@@ -34,7 +34,6 @@ c_end=$(printf '\033[m')
 c_mh=$(printf '\033[%sm' $code_mh)
 c_ex=$(printf '\033[%sm' $code_ex)
 c_png=$(printf '\033[%sm' $code_png)
-fail=0
 
 # regular file - not hard linked
 LS_COLORS="mh=$code_mh" ls -U1 --color=always file > out || fail=1
index a29b170..4fe0f65 100755 (executable)
@@ -36,7 +36,6 @@ fi
 touch f || framework_failure
 chown $nameless_uid f || framework_failure
 
-fail=0
 
 set -- `ls -o f` || fail=1
 test $3 = $nameless_uid || fail=1
index e2c7f41..a3421c8 100755 (executable)
@@ -34,7 +34,6 @@ out
 symlink
 EOF
 
-fail=0
 
 ls -1 > out || fail=1
 
index c551f17..c2ddf75 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 require_strace_ capget
 
-fail=0
 strace -e capget ls --color=always > /dev/null 2> out || fail=1
 $EGREP 'capget\(' out || skip_test_ "your ls doesn't call capget"
 
index 362e6fa..37caf6c 100755 (executable)
@@ -26,7 +26,6 @@ fi
 f=/proc/sys
 test -r $f || f=.
 
-fail=0
 ls -l $f > out || fail=1
 
 Exit $fail
index 763cab1..c021473 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 mount_points=$(df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p')
 test -z "$mount_points" && skip_test_ "this test requires a non-root mount point"
index 5a9a4dd..28f58f3 100755 (executable)
@@ -27,7 +27,6 @@ fi
 mkdir x y a b c a/1 a/2 a/3 || framework_failure
 touch f a/1/I a/1/II || framework_failure
 
-fail=0
 
 # This first example is from Andreas Schwab's bug report.
 ls -R1 a b c > out || fail=1
index 564eb3e..5ebced6 100755 (executable)
@@ -31,7 +31,6 @@ touch -d "$date" c || framework_failure
 touch -d "$date" a || framework_failure
 touch -d "$date" b || framework_failure
 
-fail=0
 
 ls -1t a b c > out || fail=1
 cat <<EOF > exp
index 98642b3..cdecd71 100755 (executable)
@@ -44,7 +44,6 @@ chmod 600 d || framework_failure
 mkdir -p e/a2345 e/b || framework_failure
 chmod 600 e || framework_failure
 
-fail=0
 
 ls --file-type d > out || fail=1
 cat <<\EOF > exp || fail=1
index c134273..cb31a98 100755 (executable)
@@ -29,7 +29,6 @@ mkdir d || framework_failure
 ln -s / d/s || framework_failure
 chmod 600 d || framework_failure
 
-fail=0
 
 ls -Log d > out
 test $? = 1 || fail=1
index 579362e..86d871e 100755 (executable)
@@ -28,7 +28,6 @@ touch x || framework_failure
 chmod a+x x || framework_failure
 ln -s x link-to-x || framework_failure
 
-fail=0
 
 # ls from coreutils 6.9 would unnecessarily stat a symlink in an unusual case:
 # When not coloring orphan and missing entries, and without ln=target,
index 9f2b149..73d6e83 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 root_dev_ino=`stat --format=%d-%i /`
 t=`pwd`
index c2dd8e7..704e2a3 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir dir || framework_failure
 ln -s dir symlink || framework_failure
 
-fail=0
 set `ls -l symlink/`
 
 # Prior to fileutils-4.0k, the following would have output `... symlink -> dir'.
index 5079885..ea94d49 100755 (executable)
@@ -27,7 +27,6 @@ mkdir subdir || framework_failure
 touch subdir/b || framework_failure
 touch subdir/a || framework_failure
 
-fail=0
 
 # Coreutils 6.8 and 6.9 would output this in the wrong order.
 ls -x subdir > out || fail=1
index 04bce0e..4e7ab0a 100755 (executable)
@@ -24,7 +24,6 @@ if test "$VERBOSE" = yes; then
   arch --version
 fi
 
-fail=0
 
 arch > out || fail=1
 uname -m > exp || fail=1
index 11d553a..34567a5 100755 (executable)
@@ -30,7 +30,6 @@ fi
 # write separately.
 mkfifo fifo || framework_failure
 
-fail=0
 
 echo 1 > exp
 
index 8c19987..3fac2d0 100755 (executable)
@@ -29,7 +29,6 @@ f=/proc/cpuinfo
 test -f $f \
   || skip_test_ "no $f"
 
-fail=0
 
 # Yes, parts of /proc/cpuinfo might change between cat runs.
 # If that happens, consider choosing a file that's less likely to change,
index 723bfd0..417163d 100755 (executable)
@@ -14,7 +14,6 @@ skip_if_mcstransd_is_running_
 mkdir -p d/sub/s2 || framework_failure
 touch f g d/sub/1 d/sub/2 || framework_failure
 
-fail=0
 
 # Set to a specified context.
 # Use root:object_r:tmp_t:s0.  It is special in that
index a9efbff..148549a 100755 (executable)
@@ -9,7 +9,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # neither context nor file
 chcon 2> /dev/null && fail=1
index f200f14..c06da55 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 require_root_
 
-fail=0
 
 # Verify that root credentials are kept.
 test $(chroot / whoami) = root || fail=1
index 877ad0a..38fd284 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # These tests verify exact status of internal failure; since none of
 # them actually run a command, we don't need root privileges
index fe911d8..fec1add 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 p=$abs_top_builddir
 
-fail=0
 
 # Ensure these exit successfully, even though stdout is closed,
 # because they generate no output.
index e4ba20e..bf3865e 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # csplit could get a failed assertion to 2.0.17
 (echo a; echo; echo) > in
index ff19408..c3d2f81 100755 (executable)
@@ -26,7 +26,6 @@ fi
 . $srcdir/test-lib.sh
 
 
-fail=0
 
 # It would be easier simply to sleep for two seconds between two runs
 # of `date --date="21:04 +0100" +%S` and ensure that both outputs
index dcfeaa5..99d200e 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
               df -P . > t1 || fail=1
 BLOCK_SIZE=1M df -P . > t2 || fail=1
index fb3be29..ab6ee76 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # Verify clearing the environment
 a=1
index 432c659..031fbb0 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # POSIX is clear that environ may, but need not be, sorted.
 # Environment variable values may contain newlines, which cannot be
index 6b80f3b..5562230 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 false --version > /dev/null && fail=1
 false --help > /dev/null && fail=1
 
index bcabd99..561a753 100755 (executable)
@@ -57,7 +57,6 @@ cat <<\EOF > exp || framework_failure
  y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y
 EOF
 
-fail=0
 
 fmt -s in > out || fail=1
 
index b2cb3bc..05cb6dd 100755 (executable)
@@ -26,7 +26,6 @@ require_built_ groups
 
 # Coreutils 6.9 and earlier failed to display information on first argument
 # if later argument was --.
-fail=0
 groups none -- > out 2>&1 && fail=1
 echo $? >> out
 groups -- none -- > exp 2>&1 && fail=1
index 41e3c71..f39fe43 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 require_built_ groups
 
-fail=0
 groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1
 id --version | sed '/^$/q' > exp || fail=1
 
index a93e2ce..06bd1cc 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 echo abc > in || framework_failure
 
-fail=0
 (head -c1; head -c1) < in > out || fail=1
 case "`cat out`" in
   ab) ;;
index a3aba32..a40c762 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 (echo a; echo b) > in || framework_failure
 
-fail=0
 (head -n 1 >/dev/null; cat) < in > out || fail=1
 cat <<EOF > exp
 b
index da55907..6028356 100755 (executable)
@@ -43,7 +43,6 @@ expected_failure_status_dir=2
 expected_failure_status_ls=2
 expected_failure_status_vdir=2
 
-fail=0
 
 test "$built_programs" \
   || { echo "$this_test: no programs built!?!" 1>&2; Exit $fail; }
index c6c5e89..4ccf335 100755 (executable)
@@ -24,7 +24,6 @@ fi
 # Require selinux - when selinux is disabled, id never prints scontext.
 require_selinux_
 
-fail=0
 
 # Check without specified user, context string should be present.
 id | grep context= >/dev/null || fail=1
index dc0f54c..83924ef 100755 (executable)
@@ -22,7 +22,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 id -G $(id -nu) || fail=1
 
 Exit $fail
index abdd429..67cbab9 100755 (executable)
@@ -46,7 +46,6 @@ touch -a -d "$u2" b || framework_failure
 sleep 2
 touch -a -d "$u1" a || framework_failure
 
-fail=0
 
 # A has ctime more recent than C.
 set `ls -c a c`
index f37631f..625e66e 100755 (executable)
@@ -24,7 +24,6 @@ if test "$VERBOSE" = yes; then
   md5sum --version
 fi
 
-fail=0
 
 (mkdir tmp && cd tmp && seq 500 | xargs touch)
 
index 0f3de38..ccec5bc 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 umask 777
 
index f85666e..30a88fe 100755 (executable)
@@ -56,7 +56,6 @@ else
   skip_test_ "this test must be run at nice level 0"
 fi
 
-fail=0
 while :; do
   test_name=$1
   args=$2
index 7a1bbe8..c621cea 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # These tests verify exact status of internal failure.
 nice -n 1 # missing command
index 2c4703c..a0fd10c 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 echo a | nl > out || fail=1
 echo b | nl -s%n >> out || fail=1
index 9681058..06e9ab4 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 nohup sh -c 'echo stdout; echo stderr 1>&2' 2>err || fail=1
 
index cf4185a..df1c997 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 echo abcdefg > in || framework_failure
 
-fail=0
 
 (od -An -N3 -c; od -An -N3 -c) < in > out
 cat <<EOF > exp || fail=1
index 8d049ec..3ab3134 100755 (executable)
@@ -29,7 +29,6 @@ fi
 seq 19 > in || framework_failure
 test `wc -c < in` -eq 48 || framework_failure
 
-fail=0
 
 list='a c dC dS dI dL oC oS oI oL uC uS uI uL xC xS xI xL fF fD fL'
 for format1 in $list; do
index 6cb5692..0019048 100755 (executable)
@@ -29,7 +29,6 @@ od -t x8 /dev/null >/dev/null ||
 
 echo abcdefgh |tr -d '\n' > in || framework_failure
 
-fail=0
 
 od -An -t x8 in > out-raw || fail=1
 sed 's/^ //;s/\(..\)/\1 /g;s/ $//' out-raw \
index 3e3d97c..4f98336 100755 (executable)
@@ -26,7 +26,6 @@ skip_if_root_
 
 touch file || framework_failure
 
-fail=0
 
 # This should exit nonzero.  Before 2.0.13, it gave a diagnostic,
 # but exited successfully.
index bc51fca..c2bd2e4 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # Without arguments, printenv behaves like env.  Some shells provide
 # printenv as a builtin, so we must test via absolute name.
index 8961b44..14682dc 100755 (executable)
@@ -26,7 +26,6 @@ fi
 . $srcdir/test-lib.sh
 getlimits_
 
-fail=0
 
 # Verify the 3 methods of specifying "Escape":
 test $("$prog" "\x1b\n\33\n\e\n" | uniq -u) && fail=1
index cf272f0..36fd326 100755 (executable)
@@ -26,7 +26,6 @@ fi
 . $srcdir/test-lib.sh
 
 
-fail=0
 
 "$prog" '\x7e3\n' > out || fail=1
 cat <<\EOF > exp
index d50d9e8..5f1923e 100755 (executable)
@@ -26,7 +26,6 @@ fi
 . $srcdir/test-lib.sh
 require_ulimit_
 
-fail=0
 
 # Up to coreutils-6.9, "printf %.Nf 0" would encounter an ENOMEM internal
 # error from glibc's printf(3) function whenever N was large relative to
index 038109d..81147e3 100755 (executable)
@@ -28,7 +28,6 @@ fi
 f=01234567890123456789012345678901234567890123456789
 touch $f empty || framework_failure
 
-fail=0
 
 # Specifying a regular expression ending in a lone backslash
 # would cause ptx to write beyond the end of a malloc'd buffer.
index 6c02421..35546f7 100755 (executable)
@@ -35,7 +35,6 @@ test "x$PWD" = "x$base" || framework_failure
 cd c || framework_failure
 test "x$PWD" = "x$base/c" || skip_test_ "cd does not properly update \$PWD"
 
-fail=0
 env -- pwd -L > out || fail=1
 printf %s\\n "$base/c" > exp || fail=1
 
index f5c7ae2..2f2e599 100755 (executable)
@@ -38,7 +38,6 @@ mkdir -p a/b || framework_failure
 cd a/b || framework_failure
 chmod a=x .. || framework_failure
 
-fail=0
 env -- pwd > exp || fail=1
 readlink -ev . > out || fail=1
 
index b6d1c81..507c9d1 100755 (executable)
@@ -35,7 +35,6 @@ mkdir d          || framework_failure
 echo 2 > d/2     || framework_failure
 ln -s ../s/2 d/1 || framework_failure
 
-fail=0
 # With coreutils-6.9, this would fail with ELOOP.
 readlink -v -e p/1 > out || fail=1
 # readlink -e d/2 > exp || fail=1
index 85fe745..4aaa414 100755 (executable)
@@ -26,7 +26,6 @@ fi
 diag='runcon: runcon may be used only on a SELinux kernel'
 echo "$diag" > exp || framework_failure
 
-fail=0
 
 # This test works even on systems without SELinux.
 # On such a system it fails with the above diagnostic, which is fine.
index 8211c80..a56ad06 100755 (executable)
@@ -20,7 +20,6 @@ touch f || framework_failure
 mkdir d s1 s2 || framework_failure
 mkfifo p || framework_failure
 
-fail=0
 
 # special context that works both with and without mcstransd
 ctx=root:object_r:tmp_t:s0
index 6990f65..1656086 100755 (executable)
@@ -44,7 +44,6 @@ $CC -c long.c \
 a=$INTMAX_MAX
 b=$INTMAX_OFLOW
 
-fail=0
 seq $a $b > out || fail=1
 printf "$a\n$b\n" > exp || fail=1
 compare out exp || fail=1
index ed9d105..e25b4c0 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 for opt in --exact --zero; do
   echo a > a || fail=1
index 712c7bd..b37392e 100755 (executable)
@@ -35,7 +35,6 @@ shred: f: removing
 shred: f: renamed to 0
 shred: f: removed" > exp || framework_failure
 
-fail=0
 
 shred -v -u f 2>out || fail=1
 
index f0fd5f9..6ffe9bd 100755 (executable)
@@ -31,7 +31,6 @@ file=0123456789
 touch $file || framework_failure
 chmod u-w $file || framework_failure
 
-fail=0
 
 # This would take so long that it appears to infloop
 # when using version from fileutils-4.0k.
index 3013aae..a794414 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 seq 100 > in || framework_failure
 
-fail=0
 shuf in >out || fail=1
 
 # Fail if the input is the same as the output.
index 7e319ca..7e4278e 100755 (executable)
@@ -30,7 +30,6 @@ SORT="$abs_top_builddir/src/sort"
 # Ensure that $TMPDIR is valid.
 TMPDIR=.; export TMPDIR
 
-fail=0
 
 # This should force the use of temp files
 sort -S 1k in > out || fail=1
index 8b206f3..d45eb53 100755 (executable)
@@ -31,7 +31,6 @@ for i in $(seq 31); do
   echo $i | tee -a in > __test.$i || framework_failure
 done
 
-fail=0
 
 (
  ulimit -n 6
index 82305be..3071613 100755 (executable)
@@ -27,7 +27,6 @@ require_ulimit_
 
 mkdir in err || framework_failure
 
-fail=0
 
 for i in `seq 17`; do
   echo $i >in/$i
index a9027d2..071ad85 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 seq 100 > in || framework_failure
 
-fail=0
 
 sort --random-sort in > out || fail=1
 
index 32b0ed2..e046c3b 100755 (executable)
@@ -105,7 +105,6 @@ cat > exp <<- _EOF_
         string start 5.90.0 end of str
         _EOF_
 
-fail=0
 sort --sort=version -o out in || fail=1
 compare exp out || fail=1
 Exit $fail
index 88d225a..37cd3cd 100755 (executable)
@@ -41,7 +41,6 @@ done > exp || framework_failure
 echo split: output file suffixes exhausted \
   > exp-too-short || framework_failure
 
-fail=0
 
 # This should fail.
 split -b 1 -a 1 in 2> err && fail=1
index ad38e60..70ee0c0 100755 (executable)
@@ -26,7 +26,6 @@ getlimits_
 
 touch in || framework_failure
 
-fail=0
 
 split -a 0 in 2> /dev/null || fail=1
 split -b 0 in 2> /dev/null && fail=1
index 808a344..f6cf467 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 printf '1\n2\n3\n4\n5\n' > in || framework_failure
 
-fail=0
 split --lines=2 in > out || fail=1
 cat <<\EOF > exp-1
 1
index 67dac8b..4ffc4c7 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 
 
-fail=0
 
 for i in `seq 50`; do
   fmt=`printf "%${i}s" %`
index f0757fe..b9a1556 100755 (executable)
@@ -26,7 +26,6 @@ fi
 printf -- '-\n' > exp || framework_failure
 touch f || framework_failure
 
-fail=0
 stat --format=%n - < f > out || fail=1
 stat -f - < f && fail=1
 
index cda94c5..cea8dcb 100755 (executable)
@@ -35,7 +35,6 @@ directory
 directory
 EOF
 
-fail=0
 # This failed on Solaris 9 for coreutils 8.0.
 stat --format=%n link1 > out || fail=1
 stat --format=%n link1/ >> out && fail=1
index 90e45d7..b6e52a4 100755 (executable)
@@ -40,7 +40,6 @@ esac
 # write separately.
 mkfifo fifo || framework_failure
 
-fail=0
 
 # Verify input parameter checking
 stdbuf -o1 true || fail=1 # verify size syntax
index a7f93ca..cb3fee5 100755 (executable)
@@ -40,7 +40,6 @@ REV_ctlecho=1 REV_echoke=1 REV_crtkill=1 REV_evenp=1 REV_parity=1
 REV_oddp=1 REV_nl=1 REV_cooked=1 REV_raw=1 REV_pass8=1 REV_litout=1
 REV_cbreak=1 REV_decctlq=1 REV_tabs=1 REV_lcase=1 REV_LCASE=1
 
-fail=0
 
 saved_state=.saved-state
 stty --save > $saved_state || fail=1
index d9f0777..638024f 100755 (executable)
@@ -25,7 +25,6 @@ fi
 require_controlling_input_terminal_
 trap '' TTOU # Ignore SIGTTOU
 
-fail=0
 
 saved_state=`stty -g` || fail=1
 stty $saved_state || fail=1
index c98ab15..5efc7dd 100755 (executable)
@@ -60,7 +60,6 @@ set $tests
 saved_size=`stty size` && test -n "$saved_size" \
   || skip_test_ "can't get window size"
 
-fail=0
 while :; do
   test_name=$1
   args=$2
index f00edc9..473c763 100755 (executable)
@@ -24,7 +24,6 @@ if test "$VERBOSE" = yes; then
   su --version
 fi
 
-fail=0
 
 # Very little that we can test without a root password
 su --- / true # unknown option
index 918c00e..6a1c63e 100755 (executable)
@@ -32,7 +32,6 @@ export LC_ALL
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # FYI, 16843009 is floor (2^32 / 255).
 
index d385660..afdc79f 100755 (executable)
@@ -54,7 +54,6 @@ fi
 
 seq 5 > in
 
-fail=0
 
 # Give tac a fifo command line argument.
 # This makes it try to create a temporary file in $TMPDIR.
index 86eca7d..7a76d64 100755 (executable)
@@ -26,7 +26,6 @@ fi
 echo line >sample || framework_failure
 nums=`seq 9` || framework_failure
 
-fail=0
 for n in 0 $nums; do
         files=`seq $n`
         rm -f $files
index 5dbb5c4..ecf414c 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 tee - </dev/null || fail=1
 
 Exit $fail
index 08734e6..77a4205 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # no timeout
 timeout 1 true || fail=1
index 02b63a7..c8b1eff 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 getlimits_
 
-fail=0
 
 # internal errors are 125, distinct from execution failure
 
index dd63b20..73e2021 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 
 ln -s truncate-target t-symlink
-fail=0
 
 truncate -s0 t-symlink || fail=1
 
index 7472c2e..aace90a 100755 (executable)
@@ -28,7 +28,6 @@ fi
 . $srcdir/test-lib.sh
 skip_if_root_
 
-fail=0
 
 d1=no
 
index a521a82..aef4417 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkfifo_or_skip_ "fifo"
 
-fail=0
 
 truncate -s0 "fifo" || fail=1
 
index 346e04e..f0ab06e 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # truncate -c no-such-file should not fail.
 truncate -s0 -c no-such-file || fail=1
index 2b16f01..afd12a5 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 getlimits_
 
-fail=0
 
 # -= overflow
 truncate -s-1 create-zero-len-file || fail=1
index 61cbe8b..c7bdf61 100755 (executable)
@@ -35,7 +35,6 @@ chmod g+w root-owned
 # Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
 chmod g+x .
 
-fail=0
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" truncate -s0 root-owned || fail=1
 
 Exit $fail
index 8bef6d1..ce3f8ac 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # must specify at least 1 file
 truncate --size=0 && fail=1
index 9916ec6..976eeb8 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # mixture of relative modifiers not allowed
 truncate --size="+>0" file && fail=1
index 3da8fcd..1d1d765 100755 (executable)
@@ -27,7 +27,6 @@ echo 2 > 2b || framework_failure
 echo 2 words > 2w || framework_failure
 printf '2b\n2w\n' |tr '\n' '\0' > names || framework_failure
 
-fail=0
 
 wc --files0-from=names > out || fail=1
 cat <<\EOF > exp || fail=1
index fcf7ceb..ed08955 100755 (executable)
@@ -55,7 +55,6 @@ getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_a \
   || skip_test_ "failed to set xattr of file"
 
-fail=0
 
 # cp should not preserve xattr by default
 cp a b || fail=1
index 1d4cb17..1cb5cab 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 mkdir --parents "`pwd`/t" || fail=1
 test -d t || fail=1
 
index 9a75112..2320da1 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 mkdir --parents "`pwd`/t/u" || fail=1
 test -d t/u || fail=1
 
index 06207b2..df1c56d 100755 (executable)
@@ -30,7 +30,6 @@ mkdir no-access || framework_failure
 mkdir no-acce2s || framework_failure
 mkdir -p no-acce3s/d || framework_failure
 
-fail=0
 p=`pwd`
 (cd no-access && chmod 0 . && mkdir -p "$p/a/b" u/v) 2> /dev/null && fail=1
 test -d "$p/a/b" || fail=1
index 4d2674e..a5b9f66 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 mkdir -p d1/. || fail=1
 test -d d1 || fail=1
index 30df4fe..e39d0b9 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 ln -s . slink || framework_failure
 
-fail=0
 mkdir -p slink/x || fail=1
 test -d x || fail=1
 
index 5f2468e..0d32322 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 mkdir -pv foo/a/b/c/d >out || fail=1
 
 diff - out <<\EOF
index 69ab38c..9411775 100755 (executable)
@@ -26,7 +26,6 @@ skip_if_setgid_
 
 mkdir -m 700 e-dir || framework_failure
 
-fail=0
 
 # Make sure `mkdir -p existing-dir' succeeds
 # and that `mkdir existing-dir' fails.
index af2bdcd..370de24 100755 (executable)
@@ -27,7 +27,6 @@ skip_if_setgid_
 
 working_umask_or_skip_
 
-fail=0
 
 #                         parent        parent/dir
 # umask   -m option   resulting perm  resulting perm
index d872cb6..ddd237c 100755 (executable)
@@ -33,7 +33,6 @@ require_selinux_enforcing_
 c=invalid-selinux-context
 msg="failed to set default file creation context to \`$c':"
 
-fail=0
 # Test each of mkdir, mknod, mkfifo with "-Z invalid-context".
 
 for cmd_w_arg in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
index d1af121..4956c20 100755 (executable)
@@ -26,7 +26,6 @@ fi
 set_mode_string=u=rwx,g=rx,o=w,-s,+t
 output_mode_string=drwxr-x-wT
 
-fail=0
 tmp=t
 mkdir -m$set_mode_string $tmp || fail=1
 
index 3214bf4..4213784 100755 (executable)
@@ -24,7 +24,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 mkdir -p dir/ || fail=1
 test -d dir || fail=1
index 9c88684..5df2de1 100755 (executable)
@@ -37,7 +37,6 @@ skip_test_ temporarily disabled
 
 # FIXME: define cleanup_ to do the umount
 
-fail=0
 # FIXME: use mktemp
 cd /tmp                                    \
   && dd if=/dev/zero of=1 bs=8192 count=50 \
index e9fb626..5ad8de0 100755 (executable)
@@ -48,7 +48,6 @@ acl1=`getfacl file` || skip_partition=.
 test $skip_partition != none &&
   skip_test_ "'$skip' is not on a suitable file system for this test"
 
-fail=0
 # move the access acl of a file
 mv file "$other_partition_tmpdir" || fail=1
 acl2=`cd "$other_partition_tmpdir" && getfacl file` || framework_failure
index 8dd2265..ef78d52 100755 (executable)
@@ -35,7 +35,6 @@ require_strace_ unlink
 ln -s t1 s1 || framework_failure
 ln -s t2 s2 || framework_failure
 
-fail=0
 
 strace -qe unlink mv -T s1 s2 > out 2>&1 || fail=1
 $EGREP 'unlink.*"s1"' out && fail=1
index ae1b6e9..5dd3f35 100755 (executable)
@@ -35,7 +35,6 @@ require_strace_ unlink
 touch a b || framework_failure
 ln b b2 || framework_failure
 
-fail=0
 
 strace -qe unlink mv a b > out 2>&1 || fail=1
 $EGREP 'unlink.*"b"' out && fail=1
index e70ce85..6461644 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir A B || framework_failure
 touch X Y || framework_failure
 
-fail=0
 
 # Before coreutils-6.2, the " (backup: `B.~1~')" suffix was not printed.
 mv --verbose --backup=numbered -T A B > out || fail=1
index 7d80078..df6561b 100755 (executable)
@@ -32,7 +32,6 @@ rm -f "$a" "$a2" || framework_failure
 echo a > "$a" || framework_failure
 echo a2 > "$a2" || framework_failure
 
-fail=0
 # This mv command should exit nonzero.
 mv --b=simple "$a2" "$a" > out 2>&1 && fail=1
 
index 2f264b4..ff51a09 100755 (executable)
@@ -32,7 +32,6 @@ mkdir a b c || framework_failure
 echo a > a/f || framework_failure
 echo b > b/f || framework_failure
 
-fail=0
 
 cp a/f b/f c 2> /dev/null && fail=1
 test -f a/f || fail=1
index 75904d6..6e28fa4 100755 (executable)
@@ -28,7 +28,6 @@ touch f1 || framework_failure
 touch f2 || framework_failure
 touch d || framework_failure
 
-fail=0
 # These mv commands should all exit nonzero.
 
 # Too few args.  This first one did fail, but with an incorrect diagnostic
index 629ddb5..13d1419 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir -p dir/file || framework_failure
 > file || framework_failure
 
-fail=0
 
 # These should both fail, but until fileutils-4.0q only the second one did.
 mv dir file > /dev/null 2>&1 && fail=1
index cf161da..24afc1e 100755 (executable)
@@ -27,7 +27,6 @@ fi
 mkdir -p a/t b/t || framework_failure
 touch a/t/f || framework_failure
 
-fail=0
 
 # Expect this to fail with the expected diagnostic.
 # For an interrim (pre-6.0) release, it would give an erroneous
index 342fe45..e7fb089 100755 (executable)
@@ -28,7 +28,6 @@ fi
 . $srcdir/test-lib.sh
 skip_if_root_
 
-fail=0
 
 for i in cp; do
 
index df43970..88851ac 100755 (executable)
@@ -29,7 +29,6 @@ ff2=mvforce2
 echo force-contents > $ff || framework_failure
 ln $ff $ff2 || framework_failure
 
-fail=0
 # This mv command should exit nonzero.
 mv $ff $ff > out 2>&1 && fail=1
 
index 8822700..1bd173e 100755 (executable)
@@ -32,7 +32,6 @@ touch a || framework_failure
 ln a b || framework_failure
 ln a c || framework_failure
 
-fail=0
 
 # ======================================
 cp --preserve=link a b c dst || fail=1
index c2ff815..fbd7cc8 100755 (executable)
@@ -45,7 +45,6 @@ touch a || framework_failure
 ln a x/b || framework_failure
 ln a c || framework_failure
 
-fail=0
 
 # ======================================
 # This must fail -- because x/b cannot be unlinked.
index 9a8c832..05fba29 100755 (executable)
@@ -25,7 +25,6 @@ fi
 touch a || framework_failure
 ln a b || framework_failure
 
-fail=0
 
 mv a b || fail=1
 
index d626f3c..2df2cf3 100755 (executable)
@@ -32,7 +32,6 @@ mkdir $dir || framework_failure
 > $dir/a || framework_failure
 ln $dir/a $dir/b || framework_failure
 
-fail=0
 mv $dir "$other_partition_tmpdir" || fail=1
 
 # Display inode numbers, one per line.
index db7cdb2..0c9198c 100755 (executable)
@@ -26,7 +26,6 @@ fi
 touch x || framework_failure
 ln x y || framework_failure
 
-fail=0
 
 mv --verbose x y > out || fail=1
 cat <<\EOF > exp || fail=1
index 05ced50..3c56e31 100755 (executable)
@@ -35,7 +35,6 @@ done
 chmod 0 b d f h || framework_failure
 echo y > y || framework_failure
 
-fail=0
 mv -if a b || fail=1
 mv -fi c d < y >/dev/null 2>&1 || fail=1
 
index 738605b..bfb2a31 100755 (executable)
@@ -30,7 +30,6 @@ trap '' TTIN # Ignore SIGTTIN
 touch f g h i || framework_failure
 chmod 0 g i || framework_failure
 
-fail=0
 
 ls /dev/stdin >/dev/null 2>&1 \
   || skip_test_ 'there is no /dev/stdin file'
index bdc353c..8eaf2d6 100755 (executable)
@@ -28,7 +28,6 @@ for i in a b; do
 done
 echo y > y || framework_failure
 
-fail=0
 mv -i a b < y >/dev/null 2>&1 || fail=1
 
 # Make sure out contains the prompt.
index 0c99bac..342e66c 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir a || framework_failure
 touch b || framework_failure
 
-fail=0
 
 # coreutils 6.2 mv would neglect to prompt in this case.
 echo n | mv -i a b 2>/dev/null || fail=1
index 031e807..7a85064 100755 (executable)
@@ -31,7 +31,6 @@ ln b/FUBAR b/bar || framework_failure
 chmod a-w b/bar || framework_failure
 echo n > no || framework_failure
 
-fail=0
 
 mv a/bar a/foo b < no > out 2> err || fail=1
 touch exp
index 84b41ee..f4f598a 100755 (executable)
@@ -30,7 +30,6 @@ rm -rf $dir $file || framework_failure
 mkdir -p $dir/a/b || framework_failure
 touch $file || framework_failure
 
-fail=0
 
 # This mv command should fail.
 mv $dir $file $dir > out 2>&1 && fail=1
index 1b3e6b7..3c3e7e2 100755 (executable)
@@ -30,7 +30,6 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
 file="$other_partition_tmpdir/file"
 symlink=symlink
 
-fail=0
 
 echo whatever > $file || framework_failure
 ln -s $file $symlink || framework_failure
index e5a4f8d..b9fa41a 100755 (executable)
@@ -28,7 +28,6 @@ dir2=is3-dir2
 
 mkdir $dir1 $dir2 || framework_failure
 
-fail=0
 # This mv command should exit nonzero.
 mv $dir1 $dir2 $dir2 > out 2>&1 && fail=1
 
index baef23a..6b29fff 100755 (executable)
@@ -27,7 +27,6 @@ fi
 touch file || framework_failure
 ln -s file s || framework_failure
 
-fail=0
 
 # This must fail.
 mv s s 2> /dev/null && fail=1
index 76a6b43..86cfbcd 100755 (executable)
@@ -48,7 +48,6 @@ sed 's,$,/f,' .dirs | xargs touch
 last_file=`tail -n1 .dirs`/f
 test -f $last_file || framework_failure
 
-fail=0
 
 mv * "$other_partition_tmpdir" || fail=1
 test -f $last_file/f && fail=1
index f91fba0..448f474 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 # test miscellaneous combinations of -f -i -n parameters
 touch a b || framework_failure
index 321c54e..73f9fb4 100755 (executable)
@@ -41,7 +41,6 @@ touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure
 # from an OpenBSD system, the above mknod fails.
 # It's not worth making an exception any more.
 
-fail=0
 mv --verbose $null $dir "$other_partition_tmpdir" > out || fail=1
 # Make sure the files are gone.
 test -p $null && fail=1
index 387a75f..2ef5f2a 100755 (executable)
@@ -33,7 +33,6 @@ mkdir a b b/a || framework_failure
 mv a b ||
   skip_test_ "your kernel's rename syscall is buggy"
 
-fail=0
 
 # This should succeed, since both src and dest are directories,
 # and the dest dir is empty.
index 290864d..3d939f1 100755 (executable)
@@ -32,7 +32,6 @@ cleanup_() { t=$other_partition_tmpdir; chmod -R 700 "$t"; rm -rf "$t"; }
 touch k "$other_partition_tmpdir/k" || framework_failure
 chmod u-w "$other_partition_tmpdir" || framework_failure
 
-fail=0
 
 mv -f k "$other_partition_tmpdir" 2> out && fail=1
 cat <<EOF > exp
index 51dea20..e158964 100755 (executable)
@@ -34,7 +34,6 @@ mkdir a b || framework_failure
 touch a/1 || framework_failure
 ln a/1 b/1 || framework_failure
 
-fail=0
 
 mv f g "$other_partition_tmpdir" || fail=1
 mv a b "$other_partition_tmpdir" || fail=1
index 45b8615..a1a6517 100755 (executable)
@@ -29,7 +29,6 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
 
 mkdir foo || framework_failure
 
-fail=0
 
 mv foo/ "$other_partition_tmpdir/bar" || fail=1
 
index a12a9f5..ed3e25b 100755 (executable)
@@ -33,7 +33,6 @@ pwd_tmp=`pwd`
 # can make this test fail.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-fail=0
 
 # Four cases:
 # local regular file w/symlink on another partition
index 41a193c..c6f8066 100755 (executable)
@@ -31,7 +31,6 @@ chmod a=rwx file
 umask 077
 mv file "$other_partition_tmpdir"
 
-fail=0
 test -f file && fail=1
 test -f "$other_partition_tmpdir/file" || fail=1
 
index b8c3bf3..88a6f40 100755 (executable)
@@ -28,7 +28,6 @@ skip_if_root_
 mkdir -p no-write/dir || framework_failure
 chmod u-w no-write || framework_failure
 
-fail=0
 
 mv no-write/dir . > out 2>&1 && fail=1
 cat <<\EOF > exp
index f8855a2..7187e80 100755 (executable)
@@ -43,7 +43,6 @@ chown "$NON_ROOT_USERNAME" "$other_partition_tmpdir" || framework_failure
 # We have to allow $NON_ROOT_USERNAME access to ".".
 chmod go+x . || framework_failure
 
-fail=0
 
 # Ensure that $NON_ROOT_USERNAME can access the required version of mv.
 version=`setuidgid $NON_ROOT_USERNAME env PATH="$PATH" mv --version|sed -n '1s/.* //p'`
index c5fc099..3806f56 100755 (executable)
@@ -30,7 +30,6 @@ rem_file="$other_partition_tmpdir/file"
 rem_symlink="$other_partition_tmpdir/symlink"
 file=to-sym-$$
 
-fail=0
 
 rm -f $file || framework_failure
 echo local > $file || framework_failure
index 24ab722..a86626a 100755 (executable)
@@ -28,7 +28,6 @@ fi
 
 mkdir foo || framework_failure
 
-fail=0
 
 mv foo/ bar || fail=1
 
index ae3127f..cf6e471 100755 (executable)
@@ -28,7 +28,6 @@ echo old > old || framework_failure
 touch -d yesterday old || framework_failure
 echo new > new || framework_failure
 
-fail=0
 
 for interactive in '' -i; do
   for cp_or_mv in cp mv; do
index 58a7148..bbf81f1 100755 (executable)
@@ -27,7 +27,6 @@ pwd=`pwd`
 my_pwd=$("$abs_top_builddir/src/pwd")
 tmp=d
 
-fail=0
 mkdir $tmp || framework_failure
 cd $tmp || framework_failure
 
@@ -41,7 +40,6 @@ ln -s subdir/missing link4 || framework_failure
 
 cd "$pwd/$tmp/removed" || framework_failure
 
-fail=0
 # Skip this test if the system doesn't let you remove the working directory.
 if rmdir ../removed 2>/dev/null; then
   v=`readlink -e .` && fail=1
index a702ba9..a2bb5fd 100755 (executable)
@@ -27,7 +27,6 @@ pwd=`pwd`
 my_pwd=$("$abs_top_builddir/src/pwd")
 tmp=d
 
-fail=0
 mkdir $tmp || framework_failure
 cd $tmp || framework_failure
 
@@ -42,7 +41,6 @@ ln -s link5 link5 || framework_failure
 
 cd "$pwd/$tmp/removed" || framework_failure
 
-fail=0
 # Skip this test if the system doesn't let you remove the working directory.
 if rmdir ../removed 2>/dev/null; then
   v=`readlink -e .` && fail=1
index 53528c2..80d3e2d 100755 (executable)
@@ -27,7 +27,6 @@ pwd=`pwd`
 my_pwd=$("$abs_top_builddir/src/pwd")
 tmp=d
 
-fail=0
 mkdir $tmp || framework_failure
 cd $tmp || framework_failure
 
@@ -41,7 +40,6 @@ ln -s subdir/missing link4 || framework_failure
 
 cd "$pwd/$tmp/removed" || framework_failure
 
-fail=0
 # Skip this test if the system doesn't let you remove the working directory.
 if rmdir ../removed 2>/dev/null; then
   v=`readlink -e .` && fail=1
index 7dfc8b7..3eadbbc 100755 (executable)
@@ -28,7 +28,6 @@ touch regfile || framework_failure
 ln -s regfile link1 || framework_failure
 ln -s missing link2 || framework_failure
 
-fail=0
 
 v=`readlink link1` || fail=1
 test "$v" = regfile || fail=1
index d971547..ffac61d 100755 (executable)
@@ -28,7 +28,6 @@ mkdir -p a/b
 touch a/b/file
 chmod u-w a/b
 
-fail=0
 
 rm -rf a a 2>&1 | sed 's/:[^:]*$//' > out || fail=1
 cat <<\EOF > exp
index 0ee3e8a..4366474 100755 (executable)
@@ -29,7 +29,6 @@ fi
 ln -s no-file dangle
 ln -s / symlink
 
-fail=0
 
 rm ---presume-input-tty dangle symlink &
 pid=$!
index 98f100a..3585ef5 100755 (executable)
@@ -32,7 +32,6 @@ fi
 
 umask 022
 
-fail=0
 
 k20=/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k
 k200=$k20$k20$k20$k20$k20$k20$k20$k20$k20$k20
index 20fb278..34c733f 100755 (executable)
@@ -41,7 +41,6 @@ $PERL \
 cd .. || framework_failure
 echo n > no || framework_failure
 
-fail=0
 rm ---presume-input-tty -r x < no > out || fail=1
 
 # expect empty output
index ee0829a..ff8825e 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 mkdir --mode=0500 unwritable-dir || framework_failure
 
-fail=0
 
 # For rm from coreutils-5.0.1, this would prompt.
 rm ---presume-input-tty unwritable-dir < /dev/null > out-t 2>&1 && fail=1
index 320a718..3c6f041 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 mkdir d || framework_failure
 
-fail=0
 
 rm d 2> out && fail=1
 cat <<\EOF > exp || fail=1
index c69ad88..5e59c4d 100755 (executable)
@@ -27,7 +27,6 @@ fi
 mkdir a b || framework_failure
 touch a/f b/f || framework_failure
 
-fail=0
 
 rm -r a b || fail=1
 
index 779f96b..c0a77e4 100755 (executable)
@@ -30,7 +30,6 @@ mkdir -m0 inacc || framework_failure
 # that is empty (hence removable) and unreadable.
 mkdir -m a-r -p a/unreadable
 
-fail=0
 
 # This would fail for e.g., coreutils-5.93.
 rm -rf inacc || fail=1
index ad97e17..90ba9bb 100755 (executable)
@@ -72,7 +72,6 @@ echo creating a $n-entry directory took $setup_duration seconds
 test $threshold_seconds -lt $setup_duration \
   && threshold_seconds=$setup_duration
 
-fail=0
 start=$(date +%s)
 timeout ${threshold_seconds}s rm -rf d; err=$?
 duration=$(expr $(date +%s) - $start)
index b00f0a6..07a68ad 100755 (executable)
@@ -27,7 +27,6 @@ fi
 
 mkdir -p d || framework_failure
 
-fail=0
 rm -f d/no-such-file || fail=1
 
 Exit $fail
index 4cfb511..4c4ae74 100755 (executable)
@@ -32,7 +32,6 @@ mkdir a || framework_failure
 chmod 1777 a || framework_failure
 touch a/b || framework_failure
 
-fail=0
 
 # Try to ensure that $NON_ROOT_USERNAME can access
 # the required version of rm.
index 954bd7e..4481ce4 100755 (executable)
@@ -41,7 +41,6 @@ mkdir e           &&
   ok=1
 test $ok = 1 || framework_failure
 
-fail=0
 
 rm -rf d/f 2> out && fail=1
 cat <<\EOF > exp
index 5f9d126..8629cba 100755 (executable)
@@ -35,7 +35,6 @@ for i in 1 2 3; do
   done
 done
 
-fail=0
 
 rm -r t || fail=1
 
index be074f0..a7474fe 100755 (executable)
@@ -33,7 +33,6 @@ test -f $t/a || framework_failure
 echo y > $t/$test.Iy
 echo n > $t/$test.In
 
-fail=0
 rm -i $t/a < $t/$test.In > /dev/null 2>&1 || fail=1
 # The file should not have been removed.
 test -f $t/a || fail=1
index fc6b069..35c0ac3 100755 (executable)
@@ -29,7 +29,6 @@ touch f || framework_failure
 chmod 0 f || framework_failure
 touch exp || framework_failure
 
-fail=0
 
 rm --interactive=never f > out || fail=1
 
index 8efb063..78eb99a 100755 (executable)
@@ -28,7 +28,6 @@ fi
 mkdir dir || framework_failure
 echo y > y || framework_failure
 
-fail=0
 
 # This must fail.
 rm -i dir < y > /dev/null 2>&1 && fail=1
index 747d4d2..714631e 100755 (executable)
@@ -26,7 +26,6 @@ skip_if_root_
 
 touch existing-non-dir || framework_failure
 
-fail=0
 
 # With coreutils-6.3, this would exit nonzero.  It should not.
 # Example from Andreas Schwab.
index f40a342..b894f49 100755 (executable)
@@ -32,7 +32,6 @@ skip_if_root_
 p=`pwd`
 mkdir abs1 abs2 no-access || framework_failure
 
-fail=0
 
 set +x
 (cd no-access; chmod 0 . && rm -r "$p/abs1" rel "$p/abs2") 2> out && fail=1
index bab99b1..842acc1 100755 (executable)
@@ -32,7 +32,6 @@ echo 'n
 y' > $test.I || framework_failure
 rm -f out err || framework_failure
 
-fail=0
 
 # The prompt has a trailing space, and no newline, so an extra
 # 'echo .' is inserted after each rm to make it obvious what was asked.
index 7e3a757..9c1f46d 100755 (executable)
@@ -32,7 +32,6 @@ echo y > $test.Iy || framework_failure
 echo n > $test.In || framework_failure
 rm -f out err || framework_failure
 
-fail=0
 
 # The prompt has a trailing space, and no newline, so an extra
 # 'echo .' is inserted after each rm to make it obvious what was asked.
index 6589d84..2b0cfa3 100755 (executable)
@@ -49,7 +49,6 @@ EOF
 # Remove all but one of a, b, c -- I doubt that this test can portably
 # determine which one was removed based on order of dir entries.
 # This is a good argument for switching to a dejagnu-style test suite.
-fail=0
 rm --verbose -i -r $t < $test.I > /dev/null 2>&1 || fail=1
 
 # $t should not have been removed.
index 15b50b7..c1bb818 100755 (executable)
@@ -24,7 +24,6 @@ fi
 . $srcdir/test-lib.sh
 skip_if_root_
 
-fail=0
 
 # Skip this test if there is no /dev/stdin file.
 ls /dev/stdin >/dev/null 2>&1 \
index 0c6aefa..a0ba383 100755 (executable)
@@ -32,7 +32,6 @@ chown -R $NON_ROOT_USERNAME d || framework_failure
 # Ensure that non-root can access files in root-owned ".".
 chmod go=x . || framework_failure
 
-fail=0
 
 # This must fail, since `.' is not writable by $NON_ROOT_USERNAME.
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf d 2>/dev/null && fail=1
index db00a5b..8ce6e65 100755 (executable)
@@ -44,7 +44,6 @@ cat <<\EOF > exp || framework_failure
 rm: skipping `a/b', since it's on a different device
 EOF
 
-fail=0
 
 rm --one-file-system -rf a 2> out && fail=1
 test -d $t/y || fail=1
index b4fec90..cd484e6 100755 (executable)
@@ -35,7 +35,6 @@ removed directory: `a'
 removed `b'
 EOF
 
-fail=0
 rm --verbose -r a b > $test.O || fail=1
 
 for d in $dirs; do
index 91463f8..a0a49e6 100755 (executable)
@@ -38,7 +38,6 @@ EOF
 
 # Note that both the expected output (above) and the actual output lines
 # are sorted, because directory entries may be processed in arbitrary order.
-fail=0
 rm --verbose -r t/a | sort > t/O || fail=1
 
 if test -d t/a; then
index 5d078b8..b1ad2e0 100755 (executable)
@@ -46,7 +46,6 @@ test -f 0a || framework_failure
 test -f by || framework_failure
 cd .. || framework_failure
 
-fail=0
 rm -rf t || fail=1
 test -d t && fail=1
 
index 4f41e45..1a607df 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir d || framework_failure
 touch d/a || framework_failure
 
-fail=0
 rm -fr d/. 2>/dev/null && fail=1
 rm -fr d/./ 2>/dev/null && fail=1
 rm -fr d/.//// 2>/dev/null && fail=1
index bd00460..25bcae2 100755 (executable)
@@ -35,7 +35,6 @@ for i in `seq 1 250`; do
 done
 cd .. || framework_failure
 
-fail=0
 
 # On a buggy system, this would fail with the diagnostic,
 # "cannot remove directory `b': Directory not empty"
index bcc23a2..8762b94 100755 (executable)
@@ -27,7 +27,6 @@ skip_if_root_
 mkdir -p b/a/p b/c b/d || framework_failure
 chmod u-w b/a || framework_failure
 
-fail=0
 
 # This should fail.
 rm -rf b > out 2>&1 && fail=1
index fab6140..a8d1160 100755 (executable)
@@ -29,7 +29,6 @@ mkdir -p a/1/2 b/3 || framework_failure
 mkdir a/2 a/3 || framework_failure
 chmod u-x a/1 b || framework_failure
 
-fail=0
 
 # Exercise two separate code paths -- though both result
 # in the same sort of diagnostic.
index 1ba6409..9c2a18f 100755 (executable)
@@ -34,7 +34,6 @@ mkdir d du || framework_failure
 chmod u-w fu du empty-u || framework_failure
 cd ..
 
-fail=0
 
 cat <<EOF > in
 y
index e000be1..cbc226e 100755 (executable)
@@ -26,7 +26,6 @@ skip_if_root_
 
 mkdir dir || framework_failure
 
-fail=0
 
 # This should fail.
 rm dir > /dev/null 2>&1 && fail=1
index 85d7fef..048f9a7 100755 (executable)
@@ -37,7 +37,6 @@ rm: remove directory `d/e'
 rm: remove directory `d'
 EOF
 
-fail=0
 
 rm -ir d < in > out 2>&1 || fail=1
 
index af8e2f3..74d039f 100755 (executable)
@@ -28,7 +28,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 rm -r '' > /dev/null 2>&1 && fail=1
 
 Exit $fail
index 3b7b6f2..c1bb4c2 100755 (executable)
@@ -27,7 +27,6 @@ skip_if_root_
 mkdir -p a/b || framework_failure
 chmod u-r a
 
-fail=0
 
 # This should fail.
 rm -rf a > out 2>&1 && fail=1
index 52366d4..d26843a 100755 (executable)
@@ -26,7 +26,6 @@ skip_if_root_
 
 mkdir -p a/1 b c d/2 e/3 || framework_failure
 
-fail=0
 
 t=`pwd`
 cd c
index 9aae56e..5d5b151 100755 (executable)
@@ -26,7 +26,6 @@ fi
 mkdir a || framework_failure
 touch a/x || framework_failure
 
-fail=0
 
 rm --verbose -r a/// > out || fail=1
 cat <<\EOF > exp || fail=1
index 3e25dd1..8f41a04 100755 (executable)
@@ -27,7 +27,6 @@ fi
 mkdir d d/e d/e/f || framework_failure
 chmod a-w d || framework_failure
 
-fail=0
 
 # This rmdir command outputs two diagnostics.
 # Before coreutils-5.1.2, it would mistakenly exit successfully.
index 01d6c81..80e13b0 100755 (executable)
@@ -26,7 +26,6 @@ fi
 cwd=`pwd`
 mkdir -p "$cwd/a/b/c" "$cwd/a/x" || framework_failure
 
-fail=0
 rmdir -p --ignore-fail-on-non-empty "$cwd/a/b/c" || fail=1
 # $cwd/a/x should remain
 test -d "$cwd/a/x" || fail=1
index f02a6ed..7500f43 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkdir dir || framework_failure
 
-fail=0
 
 # Prior to coreutils-4.5.2, this would fail with the following:
 # rmdir: `dir': No such file or directory
index aea6a1a..b1b9612 100644 (file)
@@ -29,7 +29,6 @@ fi
 # FIXME: cleanup_() { rm -rf "$other_partition_tmpdir"; }
 # FIXME: . "$abs_srcdir/other-fs-tmpdir"
 
-fail=0
 FIXME > out || fail=1
 cat <<\EOF > exp || fail=1
 FIXME
index 2d38d4f..104ae48 100755 (executable)
@@ -35,7 +35,6 @@ if test $chattr_a_works = 0; then
   skip_test_ "chattr +a doesn't work on this file system"
 fi
 
-fail=0
 
 for inotify in ---disable-inotify ''; do
   sleep 1 &
index 23f3c12..e8b150e 100755 (executable)
@@ -41,7 +41,6 @@ possibly because this system does not support large files;
 Consider rerunning this test on a different file system.'
 fi
 
-fail=0
 
 tail -c1 big > out || fail=1
 # Append a newline.
index e0d79fe..71f5dc0 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 echo line > in || fail=1
 # Output should be buffered since we're writing to file
 # so we're depending on the flush to write out
index 46e7ce8..fc13435 100755 (executable)
@@ -26,7 +26,6 @@ fi
 echo line > exp || framework_failure
 echo line > in || framework_failure
 
-fail=0
 timeout 1 tail -f < in > out 2> err
 
 # tail from coreutils-7.5 would fail
index 72d51d9..3ef03dd 100755 (executable)
@@ -44,7 +44,6 @@ for i in $(seq 30); do
     sleep .1
 done
 
-fail=0
 kill $tail_pid && fail=1 || :
 
 Exit $fail
index 025272c..8903239 100755 (executable)
@@ -27,7 +27,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 touch file || framework_failure
 touch tail.out || framework_failure
index 0a4b81b..c521b03 100755 (executable)
@@ -26,7 +26,6 @@ getlimits_
 
 touch empty here || framework_failure
 
-fail=0
 
 for inotify in ---disable-inotify ''; do
   # Use tail itself to create a background process to monitor,
index b9f6ae3..8c71cea 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 echo foo | timeout 2 tail -f -c3 > out || fail=1
 echo oo > exp || fail=1
 
index 406ebcc..905d66d 100755 (executable)
@@ -28,7 +28,6 @@ mkfifo_or_skip_ fifo
 echo 1 > fifo &
 echo 1 > exp || framework_failure
 
-fail=0
 timeout 1 tail -f fifo > out
 test $? = 124 || fail=1
 
index 61caafd..34bdacd 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 ksyms=/proc/ksyms
 if test -r $ksyms; then
index 514a213..416cb44 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 (echo 1; echo 2) > k || framework_failure
 
-fail=0
 
 sh -c 'read x; tail' < k > out || fail=1
 cat <<EOF > exp
index ddfbe66..cf50fa2 100755 (executable)
@@ -33,7 +33,6 @@ require_proc_pid_status_
 touch empty || framework_failure
 echo anything > nonempty || framework_failure
 
-fail=0
 
 for inotify in ---disable-inotify ''; do
   for file in empty nonempty; do
index 62498d5..9392ade 100755 (executable)
@@ -28,7 +28,6 @@ touch here || framework_failure
 touch k || framework_failure
 { touch unreadable && chmod a-r unreadable; } || framework_failure
 
-fail=0
 
 for inotify in ---disable-inotify ''; do
   timeout 1 tail -s0.1 -f $inotify not_here
index 4419742..456a30a 100644 (file)
@@ -395,3 +395,6 @@ elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
 else
   compare() { cmp "$@"; }
 fi
+
+# Initialize; all bourne shell scripts end with "Exit $fail".
+fail=0
index b13ad06..0fbcaae 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 echo 60 > exp || framework_failure
 
-fail=0
 
 # Before coreutils-7.7, this would fail, complaining of
 # an `invalid date format'.  Specifying 60 seconds *is* valid.
index f3ea29a..a16e015 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 rm -f touch-target t-symlink
 ln -s touch-target t-symlink
-fail=0
 
 # This used to infloop.
 touch t-symlink || fail=1
index 1698ab1..ef1543e 100755 (executable)
@@ -9,6 +9,5 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 touch . || fail=1
 Exit $fail
index 05db80c..310ea30 100755 (executable)
@@ -31,7 +31,6 @@ fi
 DEFAULT_SLEEP_SECONDS=2
 SLEEP_SECONDS=${SLEEP_SECONDS=$DEFAULT_SLEEP_SECONDS}
 
-fail=0
 
 # FIXME: find writable directories on other partitions
 # and run the test in those directories, too.
index 070b727..57f5038 100755 (executable)
@@ -29,7 +29,6 @@ dir=/$d1/such-dir
 # Ensure that $d1 doesn't already exist.
 ls -d $d1 2> /dev/null && framework_failure
 
-fail=0
 
 touch $dir > out 2>&1 && fail=1
 cat <<EOF > exp
index b8209a4..57bb5cf 100755 (executable)
@@ -25,7 +25,6 @@ fi
 
 mkfifo_or_skip_ fifo
 
-fail=0
 
 touch fifo || fail=1
 
index 517ad7d..3fc6681 100755 (executable)
@@ -23,7 +23,6 @@ fi
 
 . $srcdir/test-lib.sh
 
-fail=0
 
 touch -c no-file > /dev/null 2>&1 || fail=1
 touch -cm no-file > /dev/null 2>&1 || fail=1
index 28527e8..f10eca8 100755 (executable)
@@ -27,7 +27,6 @@ ln -s nowhere dangling || framework_failure
 touch file || framework_failure
 ln -s file link || framework_failure
 
-fail=0
 
 # These first tests should work on every platform.
 # -h does not create files, but it warns.  Use -c to silence warning.
index 95470c0..3090bf0 100755 (executable)
@@ -31,7 +31,6 @@ touch -d '2000-01-02 00:00' t2 || framework_failure
 set x `ls -t t1 t2`
 test "$*" = "x t2 t1" || framework_failure
 
-fail=0
 
 chmod 0 t1
 touch -d '2000-01-03 00:00' -c t1 || fail=1
index 92347bd..3dd8a80 100755 (executable)
@@ -34,7 +34,6 @@ fi
 
 skip_if_root_
 
-fail=0
 
 # Before fileutils-4.1, we'd get the following misleading
 # diagnostic instead of `...: Permission denied'.
index 4ce4ec6..e124a2e 100755 (executable)
@@ -34,7 +34,6 @@ chmod g+w root-owned
 # Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
 chmod g+x .
 
-fail=0
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" touch -d now root-owned || fail=1
 
 Exit $fail
index 988ef04..88a4425 100755 (executable)
@@ -26,7 +26,6 @@ fi
 _POSIX2_VERSION=199209; export _POSIX2_VERSION
 POSIXLY_CORRECT=1; export POSIXLY_CORRECT
 
-fail=0
 
 yearstart=01010000
 
index 8d1853b..9d21dbd 100755 (executable)
@@ -27,7 +27,6 @@ skip_if_root_
 : > read-only || framework_failure
 chmod 444 read-only || framework_failure
 
-fail=0
 
 touch read-only || fail=1
 
index ad42c1a..05704fe 100755 (executable)
@@ -26,7 +26,6 @@ fi
 
 TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure
 
-fail=0
 
 # Set times back by 5 days.
 touch --ref f --date='-5 days' f || fail=1
index 85cf488..05c2ac7 100755 (executable)
@@ -30,7 +30,6 @@ ln -s file link1 || framework_failure
 mkdir dir || framework_failure
 ln -s dir link2 || framework_failure
 
-fail=0
 
 # Trailing slash can only appear on directory or symlink-to-directory.
 # Up through coreutils 8.0, Solaris 9 failed these tests.