mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-07-28 11:29:09 +02:00
use trap stuff from sample-test
This commit is contained in:
+8
-7
@@ -14,17 +14,18 @@ fi
|
||||
. $srcdir/../lang-default
|
||||
PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
|
||||
|
||||
if test -z "$other_partition_tmpdir"; then
|
||||
exit 77
|
||||
fi
|
||||
|
||||
pwd=`pwd`
|
||||
tmp=part-fail.$$
|
||||
trap 'status=$?; cd $pwd; chmod u+w $other_partition_tmpdir;rm -rf $tmp $other_partition_tmpdir && exit $status' 0
|
||||
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
|
||||
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
if test -z "$other_partition_tmpdir"; then
|
||||
(exit 77); exit
|
||||
fi
|
||||
t0="$t0 $other_partition_tmpdir"
|
||||
|
||||
framework_failure=0
|
||||
mkdir $tmp || framework_failure=1
|
||||
mkdir -p $tmp || framework_failure=1
|
||||
cd $tmp || framework_failure=1
|
||||
touch k $other_partition_tmpdir/k || framework_failure=1
|
||||
chmod u-w $other_partition_tmpdir || framework_failure=1
|
||||
|
||||
Reference in New Issue
Block a user