diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2010-01-30 16:02:36 +0000 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-04-23 15:44:19 +0200 |
commit | c0a121c9bccc6175dc3cdb705e2ec8cb2be9f71c (patch) | |
tree | 40c41fe70aedd357135702145a2b1899c040a9c3 /tests | |
parent | c9e4ea6ee2007462554568f156838b0fb6d55c9a (diff) | |
download | coreutils-c0a121c9bccc6175dc3cdb705e2ec8cb2be9f71c.tar.xz |
tests: fix exit status of signal handlers in shell scripts
The value of `$?' on entrance to signal handlers in shell scripts
cannot be relied upon, so set the exit code explicitly.
* cfg.mk (sc_always_defined_macros, sc_system_h_headers): Set
the exit code in signal handler explicitly to 128 + SIG<SIGNAL>.
* src/Makefile.am (sc_tight_scope): Likewise.
* tests/test-lib.sh: Likewise.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-lib.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 7ad4331b6..8bf5601e5 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -408,7 +408,10 @@ remove_tmp_() # Run each test from within a temporary sub-directory named after the # test itself, and arrange to remove it upon exception or normal exit. trap remove_tmp_ 0 -trap 'Exit $?' 1 2 13 15 +trap 'Exit 129' 1 +trap 'Exit 130' 2 +trap 'Exit 141' 13 +trap 'Exit 143' 15 cd "$t_" || error_ "failed to cd to $t_" |