Replace goto with do while

This commit is contained in:
Nils O. Selåsdal
2013-11-09 10:45:47 +01:00
parent 9f563c0c7e
commit a4c6b65d5f
2 changed files with 13 additions and 10 deletions
+6 -4
View File
@@ -157,10 +157,12 @@ 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;
do {
rc = epoll_wait(mux->epoll_fd, mux->pending_events, EPOLL_WAIT_EVENTS, timeout_ms);
while (rc == -1 && errno == EINTR)
assert(rc >= 0);
if(rc < 0)