]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
use trap stuff from sample-test
authorJim Meyering <jim@meyering.net>
Sat, 15 Jun 2002 10:17:35 +0000 (10:17 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 15 Jun 2002 10:17:35 +0000 (10:17 +0000)
tests/mv/part-fail

index 1915ccb3367ead09c060019d405d8009f4ad6449..b512db7f011b1a98916dc708cead219bab7c6fc3 100755 (executable)
@@ -14,17 +14,18 @@ fi
 . $srcdir/../lang-default
 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
 
-if test -z "$other_partition_tmpdir"; then
-  exit 77
-fi
-
 pwd=`pwd`
-tmp=part-fail.$$
-trap 'status=$?; cd $pwd; chmod u+w $other_partition_tmpdir;rm -rf $tmp $other_partition_tmpdir && exit $status' 0
+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
+trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
 trap '(exit $?); exit' 1 2 13 15
 
+if test -z "$other_partition_tmpdir"; then
+  (exit 77); exit
+fi
+t0="$t0 $other_partition_tmpdir"
+
 framework_failure=0
-mkdir $tmp || framework_failure=1
+mkdir -p $tmp || framework_failure=1
 cd $tmp || framework_failure=1
 touch k $other_partition_tmpdir/k || framework_failure=1
 chmod u-w $other_partition_tmpdir || framework_failure=1