]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make io/ftwtest-sh remove temporary files on early exit.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 21 Oct 2015 21:18:21 +0000 (21:18 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 21 Oct 2015 21:18:21 +0000 (21:18 +0000)
The test io/ftwtest-sh creates a directory that at some points during
the test does not have execute permission.  To avoid leaving behind
such a directory that prevents the build directory from being removed
with a simple "rm -rf", it traps various signals to make the directory
executable and remove it before exit.  However, this doesn't cover the
case where one of the tests simply fails (which happens with cross
testing if testing on a remote system where the path to the build
directory involves a symlink, or if that remote system fell over
during testing - I think the latter is the case where the directory is
left behind with bad permissions).

This patch makes that test also trap signal 0 (exit) so that the
directory gets properly removed in such failure cases as well.

Tested in both configurations where the test passes and where it fails
to verify that the result of the test is unchanged but the directory
is no longer left behind where it was previously left behind.

* io/ftwtest-sh: Also trap on exit to remove temporary files.

ChangeLog
io/ftwtest-sh

index 1300047a7612b1c583ae0bfdba12a4155f8fc40b..66a0cce49f98fcf86eb1cb8fbc87257743d53cff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-21  Joseph Myers  <joseph@codesourcery.com>
+
+       * io/ftwtest-sh: Also trap on exit to remove temporary files.
+
 2015-10-21  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/unix/sysv/linux/i386/libc-do-syscall.S: Replace
index 478171db78e9023cc19b849c04ada6a8ba0bc47c..8669eab4854315a24f6700f96abf3f08067fe130 100644 (file)
@@ -45,7 +45,7 @@ export LC_ALL
 tmp=${objpfx}io
 tmpdir=$tmp/ftwtest.d
 
-trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
+trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
 
 if test -d $tmpdir; then
   chmod -fR a+x $tmpdir
@@ -296,4 +296,6 @@ rm $testout
 
 rm -fr $tmpdir
 
+trap '' 0
+
 exit 0