Skip to content

Commit

Permalink
Fixed timeout again
Browse files Browse the repository at this point in the history
  • Loading branch information
tareksander committed Feb 13, 2024
1 parent 9868593 commit e0cda1b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ namespace tgui::common {
std::perror("execlp");
exit(1);
}
// wait up to 15 seconds for am
// wait up to 5 seconds for termux-am
int status;
bool expired = true;
bool started = false;
for (int i = 0; i < 300; i++) {
for (int i = 0; i < 100; i++) {
int pid = waitpid(fpid, &status, WNOHANG);
if (pid == -1 && errno != EINTR) {
throw system_error(error_code(errno, system_category()));
Expand Down Expand Up @@ -289,11 +289,11 @@ namespace tgui::common {
std::perror("execlp");
exit(1);
}
// wait up to 5 seconds for am
// wait up to 15 seconds for am
int status;
bool expired = true;
bool started = false;
for (int i = 0; i < 100; i++) {
for (int i = 0; i < 300; i++) {
int pid = waitpid(fpid, &status, WNOHANG);
if (pid == -1 && errno != EINTR) {
throw system_error(error_code(errno, system_category()));
Expand All @@ -318,7 +318,7 @@ namespace tgui::common {
p.fd = mainfd;
p.events = POLLIN;

if (poll(&p, 1, 2000) == -1) {
if (poll(&p, 1, 5000) == -1) {
throw system_error(error_code(errno, system_category()));
}
if (! (p.revents & POLLIN)) {
Expand All @@ -332,7 +332,7 @@ namespace tgui::common {
mainfd = tmp;

p.fd = eventfd;
if (poll(&p, 1, 1000) == -1) {
if (poll(&p, 1, 2000) == -1) {
throw system_error(error_code(errno, system_category()));
}
if (! (p.revents & POLLIN)) {
Expand Down

0 comments on commit e0cda1b

Please sign in to comment.