void-packages/srcpkgs/glibc/patches/0012-posix-Add-cleanup-on-the-trap-list-for-globtest.sh.patch
Leah Neukirchen 57c0281eb0 glibc: update for 8 new upstream fixes.
Patches created by
git format-patch -k -p glibc-2.25..origin/release/2.25/master
2017-06-20 13:46:17 +02:00

54 lines
1.4 KiB
Diff

From b30b1c97ccfe72e82b0c95bb55274b5660bc539e Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 11 Apr 2017 15:08:02 -0300
Subject: posix: Add cleanup on the trap list for globtest.sh
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.
Cherry-pick of 4fee33f.
diff --git a/ChangeLog b/ChangeLog
index 8479fba8c4..4962000b47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-04-11 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * posix/globtest.sh: Add cleanup routine on trap 0.
+
2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
[BZ #21258]
diff --git a/posix/globtest.sh b/posix/globtest.sh
index f9cc80b4b5..73f7ae31cc 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -47,7 +47,12 @@ testout=${common_objpfx}posix/globtest-out
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
@@ -811,8 +816,6 @@ if test $failed -ne 0; then
fi
if test $result -eq 0; then
- chmod 777 $testdir/noread
- rm -fr $testdir $testout
echo "All OK." > $logfile
fi
--
2.13.1