summaryrefslogtreecommitdiff
path: root/tests/mkdir/p-1
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-19 21:17:45 +0000
committerJim Meyering <jim@meyering.net>2002-04-19 21:17:45 +0000
commitd0ae660607f2d438654a2adf13231e586c62fc3f (patch)
tree11f8d5d1802ac28c86b5a96ab301fba06019e7ef /tests/mkdir/p-1
parent5aaccdf6a7b9a56aff56d6e5be211151df2acf71 (diff)
downloadcoreutils-d0ae660607f2d438654a2adf13231e586c62fc3f.tar.xz
Use better trap.
Diffstat (limited to 'tests/mkdir/p-1')
-rwxr-xr-xtests/mkdir/p-115
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/mkdir/p-1 b/tests/mkdir/p-1
index 738ac146c..272e35eee 100755
--- a/tests/mkdir/p-1
+++ b/tests/mkdir/p-1
@@ -1,22 +1,17 @@
#!/bin/sh
-# TMPDIR should be an absolute dir for this test.
-# FIXME: enforce it
-: ${TMPDIR=/tmp}
-
if test "$VERBOSE" = yes; then
set -x
mkdir --version
fi
-temp_dir=$TMPDIR/t-mkdir.$$
-tmp=$temp_dir/a/b/c
-rm -rf $temp_dir
+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
+mkdir --parents $pwd/$tmp || fail=1
test -d $tmp || fail=1
-rm -rf $temp_dir
-
exit $fail