[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix exit status of signal handlers in shell scripts
From: |
Bruno Haible |
Subject: |
Re: [PATCH] Fix exit status of signal handlers in shell scripts |
Date: |
Sun, 31 Jan 2010 01:16:08 +0100 |
User-agent: |
KMail/1.9.9 |
Here's part 1 of the fixes, as I would like to see it. Opinions?
2010-01-30 Bruno Haible <address@hidden>
Don't use $? in a trap handler for a signal.
* gnulib-tool (trap 1-15): Exit with exit status 1.
* MODULES.html.sh (trap 1-15): Likewise.
Reported by Dmitry V. Levin <address@hidden>.
--- MODULES.html.sh.orig Sun Jan 31 01:13:08 2010
+++ MODULES.html.sh Sun Jan 31 01:11:41 2010
@@ -3357,7 +3357,7 @@
rm -rf "$tmp"
# Undo the effect of the previous 'trap' command.
trap '' 0
-trap 'func_exit $?' 1 2 3 13 15
+trap 'func_exit 1' 1 2 3 13 15
exit 0
--- gnulib-tool.orig Sun Jan 31 01:13:08 2010
+++ gnulib-tool Sun Jan 31 01:12:38 2010
@@ -4848,7 +4848,7 @@
# exit); for the others we need to call 'exit' explicitly. The value of $? is
# 128 + signal number and is set before the trap-registered command is run.
trap '' 0
-trap 'func_exit $?' 1 2 3 13 15
+trap 'func_exit 1' 1 2 3 13 15
exit 0