From 304afa5629abb37f1ba4312f89615f6694fcf9ab Mon Sep 17 00:00:00 2001 From: Simone Guscetti Date: Thu, 22 Dec 2016 10:28:11 +0100 Subject: [PATCH] Changed getopt with px4_getopt which was causing motor_test to always go to the usage function --- src/systemcmds/motor_test/motor_test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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':