]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
use better trap
authorJim Meyering <jim@meyering.net>
Fri, 19 Apr 2002 21:17:08 +0000 (21:17 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 19 Apr 2002 21:17:08 +0000 (21:17 +0000)
tests/mkdir/p-2

index 5eaf70c955957590a9295a50871cbe3a8f729b12..7e65697cb48a780fab1a32adef38c7558d8ec5ce 100755 (executable)
@@ -1,21 +1,18 @@
 #!/bin/sh
-# Just like p-1, but with TMPDIR=.
-
-TMPDIR=.
+# Just like p-1, but with an absolute path.
 
 if test "$VERBOSE" = yes; then
   set -x
   mkdir --version
 fi
 
-tmp=$TMPDIR/t-mkdir.$$
-temp_files=$tmp
-rm -rf $temp_files
+pwd=`pwd`
+tmp=`echo "$0"|sed 's,.*/,,'`.tmp
+trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap '(exit $?); exit' 1 2 13 15
 
 mkdir --parents $tmp || fail=1
 
 test -d $tmp || fail=1
 
-rm -rf $temp_files
-
 exit $fail