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.
This commit is contained in:
+3
-3
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user