From 590e0e3bacb012bc86ff46f8dbe3f1b415e9cafd Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 5 Mar 2025 18:35:50 +0100 Subject: [PATCH] core/main: correct retval for reexec/switch-root/soft-reboot For these objectives we ought to execve() at the end, i.e. if we ever hit the return path something went wrong in do_reexecute(). Let's properly report that via retval. --- src/core/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index 4db7ad15d25..89b283cca21 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2235,7 +2235,7 @@ static int invoke_main_loop( log_notice("Reexecuting."); - *ret_retval = EXIT_SUCCESS; + *ret_retval = EXIT_FAILURE; *ret_switch_root_dir = *ret_switch_root_init = NULL; return objective; @@ -2258,7 +2258,7 @@ static int invoke_main_loop( log_notice("Switching root."); - *ret_retval = EXIT_SUCCESS; + *ret_retval = EXIT_FAILURE; /* Steal the switch root parameters */ *ret_switch_root_dir = TAKE_PTR(m->switch_root); @@ -2278,7 +2278,7 @@ static int invoke_main_loop( log_notice("Soft-rebooting."); - *ret_retval = EXIT_SUCCESS; + *ret_retval = EXIT_FAILURE; *ret_switch_root_dir = TAKE_PTR(m->switch_root); *ret_switch_root_init = NULL; -- 2.47.3