disable errexit when inside EXIT trap

We need to turn off errexit in the EXIT trap otherwise we break out if
it early. Rookie mistake, and prevents the rest of the debug from
happening.

Change-Id: Ida7e277dd1693a6c594b2f721ddf15c9a169f07b
This commit is contained in:
Sean Dague 2015-05-07 06:27:06 -04:00
parent e3c883f1ba
commit f84db387fd

View File

@ -92,8 +92,15 @@ function exit_trap {
# really important that this is the *first* line in this
# function, otherwise we corrupt the exit code
local r=$?
# we don't need tracing during this
set +o xtrace
# we have to turn off errexit at this point, otherwise we're going
# to exit from this function early when the while caller ends
# (with a bad exit)
set +o errexit
if [[ $r -ne 0 ]]; then
# unwind the call stack on failures
local frame=0