mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
MAVLink app: Fix argument handling to work on all operating systems
This commit is contained in:
@@ -1352,14 +1352,16 @@ Mavlink::task_main(int argc, char *argv[])
|
||||
_datarate = 0;
|
||||
_mode = MAVLINK_MODE_NORMAL;
|
||||
|
||||
/*
|
||||
* Called via create_task with taskname followed by original argv
|
||||
* <name> mavlink start
|
||||
*
|
||||
* Remove all 3
|
||||
#ifndef __PX4_POSIX
|
||||
/* the NuttX optarg handler does not
|
||||
* ignore argv[0] like the POSIX handler
|
||||
* does, nor does it deal with non-flag
|
||||
* verbs well. Remove the application
|
||||
* name and the verb.
|
||||
*/
|
||||
argc -= 3;
|
||||
argv += 3;
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
#endif
|
||||
|
||||
/* don't exit from getopt loop to leave getopt global variables in consistent state,
|
||||
* set error flag instead */
|
||||
|
||||
Reference in New Issue
Block a user