Make iomux select/epoll handle EINTR

This commit is contained in:
Nils O. Selåsdal
2012-11-13 09:44:44 +01:00
parent d83c651707
commit c378d39dfe
2 changed files with 12 additions and 4 deletions
+4 -1
View File
@@ -157,8 +157,11 @@ static int iomux_epoll_run(struct IOMux *mux_, struct timeval *timeout)
timeout_ms = timeval_to_ms(timeout);
else
timeout_ms = -1;
again:
rc = epoll_wait(mux->epoll_fd, mux->pending_events, EPOLL_WAIT_EVENTS, timeout_ms);
if(rc == -1 && errno == EINTR)
goto again;
assert(rc >= 0);
if(rc < 0)
return errno;