diff --git a/glorytun.c b/glorytun.c index e346542..12402cc 100644 --- a/glorytun.c +++ b/glorytun.c @@ -269,15 +269,17 @@ static ssize_t fd_read_all (int fd, void *data, size_t size) }; while (done0) - done += ret; + if (ret<0) { + poll(&pollfd, 1, -1); + continue; + } + + done += ret; } return done; @@ -293,15 +295,17 @@ static ssize_t fd_write_all (int fd, const void *data, size_t size) }; while (done0) - done += ret; + if (ret<0) { + poll(&pollfd, 1, -1); + continue; + } + + done += ret; } return done;