mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
posix: exit if the startup script is not ok
In general, if anything goes wrong in the startup script, we should fail entirely because things might not work as expected. In particular, this prevents that we have to press Ctrl+C twice if the simulator start call is hung waiting for the simulator to appear and start communicating. We now press Ctrl+C once and exit straightaway whereas before we would press it once to get the warning: "Startup script returned with return value: 2", and then finally exit on the second press.
This commit is contained in:
@@ -288,6 +288,10 @@ int main(int argc, char **argv)
|
||||
|
||||
ret = run_startup_script(commands_file, absolute_binary_path, instance);
|
||||
|
||||
if (ret != 0) {
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
// We now block here until we need to exit.
|
||||
if (pxh_off) {
|
||||
wait_to_exit();
|
||||
|
||||
Reference in New Issue
Block a user