From 7c7ef7f767ea79508696d68082ac4f4b01ec749b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 21 Nov 2015 17:10:43 +0100 Subject: [PATCH] Fix system boot commandline handling --- src/platforms/posix/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/platforms/posix/main.cpp b/src/platforms/posix/main.cpp index 274db530ab..11828dad23 100644 --- a/src/platforms/posix/main.cpp +++ b/src/platforms/posix/main.cpp @@ -75,6 +75,7 @@ extern "C" { { cout.flush(); cout << endl << "floating point exception" << endl; + PX4_BACKTRACE(); cout.flush(); } } @@ -102,14 +103,17 @@ static void run_cmd(const vector &appargs, bool exit_on_fail) } arg[i] = (char *)0; + + if (exit_on_fail) { + cout << endl; + } + int retval = apps[command](i, (char **)arg); if (exit_on_fail && retval) { exit(retval); } - usleep(65000); - } else if (command.compare("help") == 0) { list_builtins(); @@ -117,11 +121,13 @@ static void run_cmd(const vector &appargs, bool exit_on_fail) // Do nothing } else { - cout << "Invalid command: " << command << "\ntype 'help' for a list of commands" << endl; + cout << endl << "Invalid command: " << command << "\ntype 'help' for a list of commands" << endl; } - print_prompt(); + if (exit_on_fail) { + print_prompt(); + } } static void usage()