diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-04-11 15:08:02 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-04-20 14:59:22 -0300 |
commit | 6636d6f4fe5e6905bfe463874b4f958ed1ae4a84 (patch) | |
tree | a2c215c93ec691b122b7a386e19c6da9e2ca6149 | |
parent | 06e821cfff89f7b9c8de5a37f81f2554f7daa934 (diff) | |
download | glibc-6636d6f4fe5e6905bfe463874b4f958ed1ae4a84.tar glibc-6636d6f4fe5e6905bfe463874b4f958ed1ae4a84.tar.gz glibc-6636d6f4fe5e6905bfe463874b4f958ed1ae4a84.tar.bz2 glibc-6636d6f4fe5e6905bfe463874b4f958ed1ae4a84.zip |
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.
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | posix/globtest.sh | 9 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2017-04-11 Adhemerval Zanella <adhemerval.zanella@linaro.org> + + * posix/globtest.sh: Add cleanup routine on trap 0. + 2017-03-31 Slava Barinov <v.barinov@samsung.com> [BZ #21289] diff --git a/posix/globtest.sh b/posix/globtest.sh index 73fe11bd76..85a3455953 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 @@ -795,8 +800,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 |