diff options
author | Jim Meyering <jim@meyering.net> | 2000-11-19 22:24:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-11-19 22:24:24 +0000 |
commit | d97f90581b4f9a4c98cd699f520b7c5bef0ea359 (patch) | |
tree | 35cc796abdb4f23318aae5f8818656d586e5b48a /tests/chmod | |
parent | 5f90e3be675cd4dd459db2fdc185bb1fb1a29d80 (diff) | |
download | coreutils-d97f90581b4f9a4c98cd699f520b7c5bef0ea359.tar.xz |
Update to use its own directory, and better trap.
Diffstat (limited to 'tests/chmod')
-rwxr-xr-x | tests/chmod/equal-x | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/chmod/equal-x b/tests/chmod/equal-x index 2e4ac55cf..b44189735 100755 --- a/tests/chmod/equal-x +++ b/tests/chmod/equal-x @@ -5,26 +5,29 @@ if test "$VERBOSE" = yes; then chmod --version fi +pwd=`pwd` tmp=eq-x-$$ -trap "rm -rf $tmp" 0 1 2 3 15 +trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 +file=f framework_failure=0 +mkdir $file || framework_failure=1 +cd $file || framework_failure=1 -rm -f $tmp -> $tmp -chmod 444 $tmp || framework_failure=1 +touch $file || framework_failure=1 +chmod 444 $file || framework_failure=1 if test $framework_failure = 1; then echo 'failure in testing framework' - exit 1 + (exit 1); exit fi umask 005 -chmod =x $tmp -case "`ls -l $tmp`" in +chmod =x $file +case "`ls -l $file`" in ---x--x---*) fail=0 ;; - *) fail=1; ls -l $tmp ;; + *) fail=1; ls -l $file ;; esac -rm -f $tmp -exit $fail +(exit $fail); exit |