mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 18:55:10 +01:00
commit
30eaadddc3
@ -140,9 +140,10 @@ void zmq::epoll_t::loop ()
|
|||||||
// Wait for events.
|
// Wait for events.
|
||||||
int n = epoll_wait (epoll_fd, &ev_buf [0], max_io_events,
|
int n = epoll_wait (epoll_fd, &ev_buf [0], max_io_events,
|
||||||
timeout ? timeout : -1);
|
timeout ? timeout : -1);
|
||||||
if (n == -1 && errno == EINTR)
|
if (n == -1) {
|
||||||
|
errno_assert (errno == EINTR);
|
||||||
continue;
|
continue;
|
||||||
errno_assert (n != -1);
|
}
|
||||||
|
|
||||||
for (int i = 0; i < n; i ++) {
|
for (int i = 0; i < n; i ++) {
|
||||||
poll_entry_t *pe = ((poll_entry_t*) ev_buf [i].data.ptr);
|
poll_entry_t *pe = ((poll_entry_t*) ev_buf [i].data.ptr);
|
||||||
|
@ -163,9 +163,10 @@ void zmq::kqueue_t::loop ()
|
|||||||
timespec ts = {timeout / 1000, (timeout % 1000) * 1000000};
|
timespec ts = {timeout / 1000, (timeout % 1000) * 1000000};
|
||||||
int n = kevent (kqueue_fd, NULL, 0, &ev_buf [0], max_io_events,
|
int n = kevent (kqueue_fd, NULL, 0, &ev_buf [0], max_io_events,
|
||||||
timeout ? &ts: NULL);
|
timeout ? &ts: NULL);
|
||||||
if (n == -1 && errno == EINTR)
|
if (n == -1) {
|
||||||
|
errno_assert (errno == EINTR);
|
||||||
continue;
|
continue;
|
||||||
errno_assert (n != -1);
|
}
|
||||||
|
|
||||||
for (int i = 0; i < n; i ++) {
|
for (int i = 0; i < n; i ++) {
|
||||||
poll_entry_t *pe = (poll_entry_t*) ev_buf [i].udata;
|
poll_entry_t *pe = (poll_entry_t*) ev_buf [i].udata;
|
||||||
|
@ -125,10 +125,10 @@ void zmq::poll_t::loop ()
|
|||||||
|
|
||||||
// Wait for events.
|
// Wait for events.
|
||||||
int rc = poll (&pollset [0], pollset.size (), timeout ? timeout : -1);
|
int rc = poll (&pollset [0], pollset.size (), timeout ? timeout : -1);
|
||||||
if (rc == -1 && errno == EINTR)
|
if (rc == -1) {
|
||||||
|
errno_assert (errno == EINTR);
|
||||||
continue;
|
continue;
|
||||||
errno_assert (rc != -1);
|
}
|
||||||
|
|
||||||
|
|
||||||
// If there are no events (i.e. it's a timeout) there's no point
|
// If there are no events (i.e. it's a timeout) there's no point
|
||||||
// in checking the pollset.
|
// in checking the pollset.
|
||||||
|
@ -168,9 +168,10 @@ void zmq::select_t::loop ()
|
|||||||
#else
|
#else
|
||||||
int rc = select (maxfd + 1, &readfds, &writefds, &exceptfds,
|
int rc = select (maxfd + 1, &readfds, &writefds, &exceptfds,
|
||||||
timeout ? &tv : NULL);
|
timeout ? &tv : NULL);
|
||||||
if (rc == -1 && errno == EINTR)
|
if (rc == -1) {
|
||||||
|
errno_assert (errno == EINTR);
|
||||||
continue;
|
continue;
|
||||||
errno_assert (rc != -1);
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If there are no events (i.e. it's a timeout) there's no point
|
// If there are no events (i.e. it's a timeout) there's no point
|
||||||
|
Loading…
Reference in New Issue
Block a user