summaryrefslogtreecommitdiff
path: root/cfg.mk
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 /cfg.mk
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 'cfg.mk')
-rw-r--r--cfg.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/cfg.mk b/cfg.mk
index 753393099..71bcb5573 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -134,7 +134,10 @@ headers_with_interesting_macro_defs = \
# Don't define macros that we already get from gnulib header files.
sc_always_defined_macros: .re-defmac
@if test -f $(srcdir)/src/system.h; then \
- trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
+ trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0; \
+ am__exit='(exit $rc); exit $rc'; \
+ trap "rc=129; $$am__exit" 1; trap "rc=130; $$am__exit" 2; \
+ trap "rc=131; $$am__exit" 3; trap "rc=143; $$am__exit" 15; \
grep -f .re-defmac $$($(VC_LIST)) \
&& { echo '$(ME): define the above via some gnulib .h file' \
1>&2; exit 1; } || :; \
@@ -153,7 +156,10 @@ sc_always_defined_macros: .re-defmac
# the headers already included via system.h.
sc_system_h_headers: .re-list
@if test -f $(srcdir)/src/system.h; then \
- trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
+ trap 'rc=$$?; rm -f .re-list; exit $$rc' 0; \
+ am__exit='(exit $rc); exit $rc'; \
+ trap "rc=129; $$am__exit" 1; trap "rc=130; $$am__exit" 2; \
+ trap "rc=131; $$am__exit" 3; trap "rc=143; $$am__exit" 15; \
grep -nE -f .re-list \
$$($(VC_LIST_EXCEPT) | grep '^src/') \
&& { echo '$(ME): the above are already included via system.h'\