This patch prevents lingering files for SIGSEGV failures by adding
a cleanup handler on trap handler. Checked on x86_64-linux-gnu.
* posix/globtest.sh: Add cleanup routine on trap 0.
+2017-04-11 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * posix/globtest.sh: Add cleanup routine on trap 0.
+
2017-04-11 Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
* sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S: Define the
rm -rf $testdir $testout
mkdir $testdir
-trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
+cleanup() {
+ chmod 777 $testdir/noread
+ rm -fr $testdir $testout
+}
+
+trap cleanup 0 HUP INT QUIT TERM
echo 1 > $testdir/file1
echo 2 > $testdir/file2
fi
if test $result -eq 0; then
- chmod 777 $testdir/noread
- rm -fr $testdir $testout
echo "All OK." > $logfile
fi