summaryrefslogtreecommitdiff
path: root/tests/cp/cp-mv-backup
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-12-04 17:33:49 +0000
committerJim Meyering <jim@meyering.net>1999-12-04 17:33:49 +0000
commitf05badd2305a8c1c1bc4c1e89109525dd0da8bb8 (patch)
treeb4ae6c53f78b8a6cc6518bc37694679f841cdf34 /tests/cp/cp-mv-backup
parent6763fa97d29f8c6ab8c2f69ba16d44e17da73864 (diff)
downloadcoreutils-f05badd2305a8c1c1bc4c1e89109525dd0da8bb8.tar.xz
(trap): Be careful to close $actual before
removing the containing directory. Otherwise, on some systems rmdir fails to remove the containing directory.
Diffstat (limited to 'tests/cp/cp-mv-backup')
-rwxr-xr-xtests/cp/cp-mv-backup4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/cp/cp-mv-backup b/tests/cp/cp-mv-backup
index 3ae81764d..b861248c8 100755
--- a/tests/cp/cp-mv-backup
+++ b/tests/cp/cp-mv-backup
@@ -15,7 +15,9 @@ pwd=`pwd`
dir=cpmvbak-$$
actual=$dir/actual
expected=$dir/expected
-trap "cd $pwd; rm -rf $dir" 0 1 2 3 15
+
+# Be careful to close $actual before removing the containing directory.
+trap "cd $pwd; exec 1<&-; rm -rf $dir" 0 1 2 3 15
mkdir $dir
unset VERSION_CONTROL SIMPLE_BACKUP_SUFFIX