Catch possible select syscall interruption

This commit is contained in:
emanuele-f 2022-07-21 23:06:11 +02:00
parent 7e7b4461fb
commit 9bf3c6e64d

View File

@ -488,7 +488,7 @@ int run_vpn(pcapdroid_t *pd) {
FD_SET(pd->vpn.tunfd, &fdset);
max_fd = max(max_fd, pd->vpn.tunfd);
if(select(max_fd + 1, &fdset, &wrfds, NULL, &timeout) < 0) {
if((select(max_fd + 1, &fdset, &wrfds, NULL, &timeout) < 0) && (errno != EINTR)) {
log_e("select failed[%d]: %s", errno, strerror(errno));
break;
}