summaryrefslogtreecommitdiff
path: root/tests/mkdir/p-2
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-19 21:17:08 +0000
committerJim Meyering <jim@meyering.net>2002-04-19 21:17:08 +0000
commit5aaccdf6a7b9a56aff56d6e5be211151df2acf71 (patch)
tree6cb6961562bd63645d102a3ceb405a2ad0eeed5c /tests/mkdir/p-2
parentdc3a2321e011bb615ca64b02a9aea5a1a853e9dd (diff)
downloadcoreutils-5aaccdf6a7b9a56aff56d6e5be211151df2acf71.tar.xz
use better trap
Diffstat (limited to 'tests/mkdir/p-2')
-rwxr-xr-xtests/mkdir/p-213
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/mkdir/p-2 b/tests/mkdir/p-2
index 5eaf70c95..7e65697cb 100755
--- a/tests/mkdir/p-2
+++ b/tests/mkdir/p-2
@@ -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