POSIX: initialize before running script

The initialization functions were called after the script
commands were run causing a deadlock waiting for an
uninitialized semaphore.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-05-06 09:51:31 -07:00
parent e28049a387
commit 5299f76706
+4 -4
View File
@@ -87,6 +87,10 @@ static void process_line(string &line)
int main(int argc, char **argv)
{
px4::init_once();
px4::init(argc, argv, "mainapp");
// Execute a command list of provided
if (argc == 2) {
ifstream infile(argv[1]);
@@ -98,10 +102,6 @@ int main(int argc, char **argv)
string mystr;
px4::init_once();
px4::init(argc, argv, "mainapp");
while(1) {
cout << "Enter a command and its args:" << endl;
getline (cin,mystr);