]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(trap): Be careful to close $actual before
authorJim Meyering <jim@meyering.net>
Sat, 4 Dec 1999 17:33:49 +0000 (17:33 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 4 Dec 1999 17:33:49 +0000 (17:33 +0000)
removing the containing directory.  Otherwise, on some systems rmdir
fails to remove the containing directory.

tests/cp/cp-mv-backup

index 3ae81764d0f755058e596b74b56039462b0b3aac..b861248c8c11edb93a3873b16e96cc38ed73e103 100755 (executable)
@@ -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