diff --git a/src/systemcmds/motor_test/motor_test.c b/src/systemcmds/motor_test/motor_test.c index 258e38e1ef..295efead05 100644 --- a/src/systemcmds/motor_test/motor_test.c +++ b/src/systemcmds/motor_test/motor_test.c @@ -39,6 +39,7 @@ */ #include +#include #include #include @@ -103,7 +104,10 @@ int motor_test_main(int argc, char *argv[]) float value = 0.0f; int ch; - while ((ch = getopt(argc, argv, "m:p:")) != EOF) { + int myoptind = 1; + const char *myoptarg = NULL; + + while ((ch = px4_getopt(argc, argv, "m:p:", &myoptind, &myoptarg)) != EOF) { switch (ch) { case 'm':