Skip to content

Commit

Permalink
don't restart select on error (presuming that's EINTR)
Browse files Browse the repository at this point in the history
Signed-off-by: Aman Gupta <aman@tmm1.net>
  • Loading branch information
smparkes authored and tmm1 committed Apr 22, 2010
1 parent b12663e commit 6911b73
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ext/em.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,12 @@ bool EventMachine_t::_RunEpollOnce()
FD_ZERO(&fdreads);
FD_SET(epfd, &fdreads);

while ((ret = rb_thread_select(epfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
if ((ret = rb_thread_select(epfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
if (ret == -1) {
assert(errno != EINVAL);
assert(errno != EBADF);
continue;
}
if (ret == 0) return true;
return true;
}

TRAP_BEG;
Expand Down Expand Up @@ -594,9 +593,8 @@ bool EventMachine_t::_RunKqueueOnce()
FD_ZERO(&fdreads);
FD_SET(kqfd, &fdreads);

while ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
if (ret == -1) continue;
if (ret == 0) return true;
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
return true;
}

TRAP_BEG;
Expand Down

0 comments on commit 6911b73

Please sign in to comment.