[arch-projects] [devtools] [PATCH] common :: cleanup avoid overwriting exit code

BlackEagle ike.devolder at gmail.com
Sat Jun 7 09:44:44 EDT 2014


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 at 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



More information about the arch-projects mailing list