Posix: add '#pragma GCC poison exit'

Generally exit() should not be used on Posix, because it exits the whole
program instead of only the task.
This commit is contained in:
Beat Küng
2018-08-31 13:28:28 +02:00
parent 9193312bd0
commit 4e6139d9fb
7 changed files with 20 additions and 7 deletions

View File

@@ -330,7 +330,7 @@ Client::_sig_handler(int sig_num)
if (_client_send_pipe_fd < 0) {
PX4_ERR("pipe open fail");
exit(-1);
system_exit(-1);
}
int bytes_to_send = get_client_send_packet_length(&packet);
@@ -338,7 +338,7 @@ Client::_sig_handler(int sig_num)
if (bytes_sent != bytes_to_send) {
PX4_ERR("write fail");
exit(-1);
system_exit(-1);
}
}

View File

@@ -115,7 +115,7 @@ void
px4_systemreset(bool to_bootloader)
{
PX4_WARN("Called px4_system_reset");
exit(0);
system_exit(0);
}
px4_task_t px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_size, px4_main_t entry,