diff --git a/src/systemcmds/reboot/reboot.c b/src/systemcmds/reboot/reboot.c index 8309d74ea4..c069b6302f 100644 --- a/src/systemcmds/reboot/reboot.c +++ b/src/systemcmds/reboot/reboot.c @@ -39,8 +39,8 @@ #include #include -#include #include +#include #include __EXPORT int reboot_main(int argc, char *argv[]); @@ -62,9 +62,19 @@ int reboot_main(int argc, char *argv[]) default: PX4_ERR("usage: reboot [-b]\n" " -b reboot into the bootloader"); + break; } } - px4_systemreset(to_bootloader); + int ret = px4_shutdown_request(true, to_bootloader); + + if (ret < 0) { + PX4_ERR("reboot failed (%i)", ret); + return -1; + } + + while (1) { usleep(1); } // this command should not return on success + + return 0; }