1
0
mirror of https://github.com/speed47/spectre-meltdown-checker synced 2024-12-22 04:13:38 +01:00

fix: bad exitcode with --update-fwdb due to trap exit

This commit is contained in:
Stéphane Lesimple 2023-02-24 20:55:41 +01:00
parent 3c988cc73a
commit 48abeb5950

View File

@ -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