From 8c7e90f7f2387072b347ac8be81afd0b5e0e2b53 Mon Sep 17 00:00:00 2001 From: Renato Carvalho Date: Thu, 25 Jan 2024 12:06:51 +0100 Subject: [PATCH] tool/run: fix corner case in exit override The run tool overrides the 'exit'-procedure to make sure that a loaded run_power_off procedure is always executed. However, a failing run_power_off lead to false-positives: 'make run/...' exited with 0 even tough the run script was not even executed because of a failed power-on/off cycle. In this case, if the run_power_off is the exit code producer, the new exit definition does not finish as intended. As a result, the first exit code is re-written, and errors are not propagated accordingly. The solution is to catch possible errors from power-off within the exit procedure. Fixes genodelabs#5102 --- tool/run/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/run/run b/tool/run/run index 48de66edbd..8bab1129d1 100755 --- a/tool/run/run +++ b/tool/run/run @@ -958,7 +958,7 @@ proc have_include { name } { # rename exit real_exit proc exit {{status 0}} { - run_power_off + catch {run_power_off} real_exit $status }