summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Engelbrecht <engeg@google.com>2020-11-02 14:24:23 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-09 19:38:26 +0000
commit03f0c3618d94b414db3855940721071e7ebe2fcc (patch)
treefda74bda3f575222f95d45e99e26a05f04e0b98b
parenta73d28c2b893954ff9cd1ba9f9051e398a6c2948 (diff)
downloadvboot-03f0c3618d94b414db3855940721071e7ebe2fcc.tar.gz
common: save the existing return value on cleanup
Currently this trap initiated function will not save the orginal return value of the script. Save it and return it on exit. BUG=chromium:1141907 TEST=unittest and manually on a signer BRANCH=None Signed-off-by: George Engelbrecht <engeg@google.com> Change-Id: Icd807f4d153e4bcc1d309fbcea43c2b3344771ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2514560 Reviewed-by: Sean McAllister <smcallis@google.com> Reviewed-by: LaMont Jones <lamontjones@chromium.org> Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2527311 Tested-by: Martin Roth <martinroth@google.com> Reviewed-by: Martin Roth <martinroth@google.com> Commit-Queue: Martin Roth <martinroth@google.com>
-rw-r--r--scripts/image_signing/common.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/image_signing/common.sh b/scripts/image_signing/common.sh
index 5f5287aa..f1fd3ef7 100644
--- a/scripts/image_signing/common.sh
+++ b/scripts/image_signing/common.sh
@@ -32,6 +32,8 @@ perform_latest_cleanup_action() {
# Performs clean up by executing actions in the cleanup_actions array in
# reversed order.
cleanup() {
+ # Save the existing return value.
+ rv=$?
set +e
while [ ${#cleanup_actions[*]} -gt 0 ]; do
@@ -39,6 +41,7 @@ cleanup() {
done
set -e
+ return $rv
}
# ANSI color codes used when displaying messages.