From d0ae660607f2d438654a2adf13231e586c62fc3f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 19 Apr 2002 21:17:45 +0000 Subject: Use better trap. --- tests/mkdir/p-1 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'tests/mkdir/p-1') 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 -- cgit v1.2.3-70-g09d2