[arch-projects] [devtools] [PATCH] common :: cleanup avoid overwriting exit code
BlackEagle (1): common :: cleanup avoid overwriting exit code lib/common.sh | 1 + 1 file changed, 1 insertion(+) -- 1.9.3
When die is called from a script it triggers cleanup with code 255. After that because EXIT is still trapped the script exits and triggers trap_exit witch calls cleanup without parameters and so overwriting the exitcode 255 to 0. Signed-off-by: BlackEagle <ike.devolder@gmail.com> --- lib/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/common.sh b/lib/common.sh index b885080..05b180d 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -64,6 +64,7 @@ setup_workdir() { } cleanup() { + trap - EXIT INT QUIT TERM HUP [[ -n $WORKDIR ]] && rm -rf "$WORKDIR" exit ${1:-0} } -- 1.9.3
On Sat, Jun 07, 2014 at 03:44:43PM +0200, BlackEagle wrote:
BlackEagle (1): common :: cleanup avoid overwriting exit code
lib/common.sh | 1 + 1 file changed, 1 insertion(+)
-- 1.9.3
Ok, i just see this is patch number 3, there were 2 submissions before for the same problem. That means you can pick whatever one you want to make it work. -- Ike
participants (2)
-
BlackEagle
-
Ike Devolder