summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-09-15 16:05:00 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-09-15 16:09:15 +0200
commit2f088ec904b9866cd5b76fbb780fcc0ef6f00107 (patch)
tree8522b07b7c6dadbdc69fc5b8dd5c92aecd1ccf76 /common
parent173d768b519e513ea5579204038acbde60b8527b (diff)
Also support poll() returning EAGAIN
Diffstat (limited to 'common')
-rw-r--r--common/tio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/tio.c b/common/tio.c
index 650f4d0..1ec1381 100644
--- a/common/tio.c
+++ b/common/tio.c
@@ -183,10 +183,10 @@ static int tio_wait(int fd, short events, int timeout,
errno = ETIME;
return -1;
}
- else if (errno != EINTR)
+ else if ((errno != EINTR) && (errno != EAGAIN))
/* some error ocurred */
return -1;
- /* we just try again on EINTR */
+ /* we just try again on EINTR or EAGAIN */
}
}
@@ -407,7 +407,7 @@ static int tio_flush_nonblock(TFILE *fp)
rv = poll(fds, 1, 0);
/* check if any file descriptors were ready (timeout) or we were
interrupted */
- if ((rv == 0) || ((rv < 0) && (errno == EINTR)))
+ if ((rv == 0) || ((rv < 0) && ((errno == EINTR) || (errno == EAGAIN))))
return 0;
/* any other errors? */
if (rv < 0)