Skip to content

Commit

Permalink
Fixing lockup on non-existing program.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacu committed May 12, 2017
1 parent 4f3c09a commit 2af883b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion support/client/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ int main( int argc, char** argv) {

}

} catch (std::runtime_error e) {
} catch (const std::runtime_error &e) {

fprintf(stderr, "Error: %s\n", e.what());
result = -1;
Expand Down
11 changes: 9 additions & 2 deletions support/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,16 @@ class TrackerProcess::State : public Synchronized {

if (!started) {
print_debug("Unable to start process");
throw new std::runtime_error("Unable to start the tracker process");
throw std::runtime_error("Unable to start the tracker process");
} else {

sleepf(0.1);
if (!process->is_alive()) {
print_debug("Unable to start process");
throw std::runtime_error("Unable to start the tracker process");
}


start_watchdog();

Logging logger = trax_no_log;
Expand Down Expand Up @@ -564,7 +571,6 @@ class TrackerProcess::State : public Synchronized {
state->flush_condition.notify();

}

if (err == -1) {
sleep(0);
continue;
Expand All @@ -575,6 +581,7 @@ class TrackerProcess::State : public Synchronized {
char chr;
bool flush = false;
int read = read_stream(err, &chr, 1);

if (read != 1) {

if (state->process_running()) err = -1;
Expand Down
2 changes: 1 addition & 1 deletion support/client/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ int main(int argc, char** argv) {

reader.release();

} catch (std::runtime_error e) {
} catch (const std::runtime_error &e) {

fprintf(stderr, "Error: %s\n", e.what());
result = -1;
Expand Down
2 changes: 1 addition & 1 deletion support/client/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ int main(int argc, char** argv) {

}

} catch (std::runtime_error e) {
} catch (const std::runtime_error &e) {

fprintf(stderr, "Error: %s\n", e.what());
result = -1;
Expand Down

0 comments on commit 2af883b

Please sign in to comment.