diff options
author | Peter O'Gorman <pogma@thewrittenword.com> | 2010-07-29 15:14:59 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-07-29 15:33:01 -0600 |
commit | c0a5d48daf5d1431bc1d010a3ec89c8b64b8f7d7 (patch) | |
tree | bb5759366d53d1fde753dabc512b3604702af9fd /tests | |
parent | 6101082ea07a4877e51042244c9c3b57920c2b62 (diff) | |
download | gnulib-c0a5d48daf5d1431bc1d010a3ec89c8b64b8f7d7.tar.gz |
init.sh: work around trap limitation of some shells
This limitation is already documented in the Autoconf manual.
* tests/init.sh (setup_): Move exit trap outside of shell function.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/init.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/init.sh b/tests/init.sh index 794352673f..bc82d69a92 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -255,9 +255,9 @@ setup_() || fail_ "failed to create temporary directory in $initial_cwd_" cd "$test_dir_" - # These trap statements ensure that the temporary directory, $test_dir_, - # is removed upon exit as well as upon receipt of any of the listed signals. - trap remove_tmp_ 0 + # This trap statement, along with a trap on 0 below, ensure that the + # temporary directory, $test_dir_, is removed upon exit as well as + # upon receipt of any of the listed signals. for sig_ in 1 2 3 13 15; do eval "trap 'Exit $(expr $sig_ + 128)' $sig_" done @@ -385,3 +385,6 @@ test -f "$srcdir/init.cfg" \ && . "$srcdir/init.cfg" setup_ "$@" +# This trap is here, rather than in the setup_ function, because some +# shells run the exit trap at shell function exit, rather than script exit. +trap remove_tmp_ 0 |