7 Jun
2014
7 Jun
'14
1:44 p.m.
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