From 48abeb595028200f9010c1e83f1545775c1768d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Fri, 24 Feb 2023 20:55:41 +0100 Subject: [PATCH] fix: bad exitcode with --update-fwdb due to trap exit --- spectre-meltdown-checker.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 07b33d4..1609875 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -18,6 +18,7 @@ trap 'exit_cleanup' EXIT trap '_warn "interrupted, cleaning up..."; exit_cleanup; exit 1' INT exit_cleanup() { + saved_ret=$? # cleanup the temp decompressed config & kernel image [ -n "${dumped_config:-}" ] && [ -f "$dumped_config" ] && rm -f "$dumped_config" [ -n "${kerneltmp:-}" ] && [ -f "$kerneltmp" ] && rm -f "$kerneltmp" @@ -30,6 +31,7 @@ exit_cleanup() [ "${insmod_msr:-}" = 1 ] && rmmod msr 2>/dev/null [ "${kldload_cpuctl:-}" = 1 ] && kldunload cpuctl 2>/dev/null [ "${kldload_vmm:-}" = 1 ] && kldunload vmm 2>/dev/null + exit $saved_ret } # if we were git clone'd, adjust VERSION