qrexec: fix handling remote domain death
Periodically (every 10s) check if connection is still alive, otherwise
killing remote domain (as it's the case of DispVM) will hang client
side.
(cherry picked from commit 5f81f0486d
)
This commit is contained in:
parent
2ee80b9b83
commit
d482add57d
|
@ -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);
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user