aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-11-21 16:29:52 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2019-11-21 16:32:01 +0100
commit6bcb2c2b0860779dc44d8dd27259f9edc6c9e6e8 (patch)
tree18605b7e817b12d12406f42aff5f7bb0e4796677
parent8dc1157684a17ef352e9444c05b7313d0c5bac17 (diff)
downloadalpine-conf-6bcb2c2b0860779dc44d8dd27259f9edc6c9e6e8.tar.bz2
alpine-conf-6bcb2c2b0860779dc44d8dd27259f9edc6c9e6e8.tar.xz
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.
-rw-r--r--libalpine.sh.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in
index f3857e2..d7b79fa 100644
--- a/libalpine.sh.in
+++ b/libalpine.sh.in
@@ -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\""
}