forked from Archive/PX4-Autopilot
gps: fix thread initialization under posix
under NuttX the argc in task_main_trampoline contains two arguments, but on linux only one.
This commit is contained in:
parent
9d0c5469a0
commit
47ed8c1a3c
|
@ -297,6 +297,7 @@ int GPS::init()
|
|||
|
||||
if (_task < 0) {
|
||||
PX4_WARN("task start failed: %d", errno);
|
||||
_task = -1;
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
@ -305,7 +306,7 @@ int GPS::init()
|
|||
|
||||
void GPS::task_main_trampoline(int argc, char *argv[])
|
||||
{
|
||||
g_dev[argv[1][0] - '1']->task_main();
|
||||
g_dev[argv[argc - 1][0] - '1']->task_main();
|
||||
}
|
||||
|
||||
int GPS::callback(GPSCallbackType type, void *data1, int data2, void *user)
|
||||
|
|
Loading…
Reference in New Issue