Skip to content

Commit

Permalink
qrexec: fix handling remote domain death
Browse files Browse the repository at this point in the history
Periodically (every 10s) check if connection is still alive, otherwise
killing remote domain (as it's the case of DispVM) will hang client
side.
  • Loading branch information
marmarek committed May 24, 2018
1 parent 4a8b10e commit 5f81f04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qrexec/qrexec-agent-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ int process_child_io(libvchan_t *data_vchan,
int remote_process_status = -1;
int ret, max_fd;
struct timespec zero_timeout = { 0, 0 };
struct timespec normal_timeout = { 10, 0 };
struct buffer stdin_buf;

sigemptyset(&selectmask);
Expand Down Expand Up @@ -386,7 +387,7 @@ int process_child_io(libvchan_t *data_vchan,
/* check for other FDs, but exit immediately */
ret = pselect(max_fd + 1, &rdset, &wrset, NULL, &zero_timeout, &selectmask);
} else
ret = pselect(max_fd + 1, &rdset, &wrset, NULL, NULL, &selectmask);
ret = pselect(max_fd + 1, &rdset, &wrset, NULL, &normal_timeout, &selectmask);
if (ret < 0) {
if (errno == EINTR)
continue;
Expand Down

0 comments on commit 5f81f04

Please sign in to comment.