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-03 07:15:11 +0000
commitfd5cd5aa9883d346b102210004b8fafecc1ba457 (patch)
treefda74bda3f575222f95d45e99e26a05f04e0b98b
parent204dfbdf7b70d798cb01e8785e8de58615ef8d16 (diff)
downloadvboot-fd5cd5aa9883d346b102210004b8fafecc1ba457.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>
-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.