mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 00:31:36 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user