summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2010-01-30 16:02:36 +0000
committerJim Meyering <meyering@redhat.com>2010-04-23 15:44:19 +0200
commitc0a121c9bccc6175dc3cdb705e2ec8cb2be9f71c (patch)
tree40c41fe70aedd357135702145a2b1899c040a9c3 /src
parentc9e4ea6ee2007462554568f156838b0fb6d55c9a (diff)
downloadcoreutils-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 'src')
-rw-r--r--src/Makefile.am5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 20b306dbc..db5359bdc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -721,7 +721,10 @@ sc_check-AUTHORS: $(all_programs)
.PHONY: sc_tight_scope
sc_tight_scope: $(bin_PROGRAMS)
@t=exceptions-$$$$; \
- trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \
+ trap 's=$$?; rm -f $$t; exit $$s' 0; \
+ am__exit='(exit $s); exit $s'; \
+ trap "s=129; $$am__exit" 1; trap "s=130; $$am__exit" 2; \
+ trap "s=141; $$am__exit" 13; trap "s=143; $$am__exit" 15; \
src=`for f in $(SOURCES); do \
test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
hdr=`for f in $(noinst_HEADERS); do \