]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Clean up traps. Create files in a subdir.
authorJim Meyering <jim@meyering.net>
Mon, 21 Aug 2000 09:45:52 +0000 (09:45 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 21 Aug 2000 09:45:52 +0000 (09:45 +0000)
tests/cp/same-file

index 6220b4f310ac0b7a402ecfccb4a733c0191fef31..534875edacd7ef062e945f0adfec249d0b35b2f8 100755 (executable)
@@ -13,12 +13,22 @@ LANG=C; export LANG
 VERSION_CONTROL=numbered; export VERSION_CONTROL
 
 pwd=`pwd`
+tmp=same-f-$$
+trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'exit $?' 1 2 13 15
+
+framework_failure=0
+mkdir $tmp || framework_failure=1
+cd $tmp || framework_failure=1
+
+if test $framework_failure = 1; then
+  echo 'failure in testing framework'
+  exit 1
+fi
+
 actual=actual-$$
 expected=expected-$$
 
-trap 'status=$?; cd $pwd; rm -rf dir $actual $expected && exit $status' 0
-trap 'exit $?' 1 2 13 15
-
 exec 1> $actual
 
 # FIXME: This should be bigger: like more than 8k