Commit 6bcb2c2b authored by Natanael Copa's avatar Natanael Copa

libalpine: use correct exit code in trap

save exit state before cleaning up tempdir so we get the correct exit
code.

This fixes the problem where lbu exit with success on errors where disk
is full or similar.
parent 8dc11576
......@@ -50,7 +50,7 @@ init_tmpdir() {
local __tmpd="/tmp/$PROGRAM-${$}-$(date +%s)-$RANDOM"
umask 077 || die "umask"
mkdir -p "$__tmpd" || exit 1
trap "rm -fr \"$__tmpd\"; exit" 0
trap "rc=\$?; rm -fr \"$__tmpd\"; exit \$rc" 0
umask $omask
eval "$1=\"$__tmpd\""
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment