Problem: zmq_poller_* uses ETIMEDOUT (instead of the usual EAGAIN) to indicate timeouts

Solution: replace ETIMEDOUT within socket_poller_t and all client code by EAGAIN

Fixes #2713
This commit is contained in:
sigiesec
2017-08-22 20:00:29 +02:00
parent 6a3c053a3e
commit a71f7b0405
4 changed files with 11 additions and 13 deletions

View File

@@ -415,7 +415,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
// no event occured within the specified timeout. Otherwise the caller
// needs to check the return value AND the event to avoid using the
// nullified event data.
errno = ETIMEDOUT;
errno = EAGAIN;
if (timeout_ == 0)
return -1;
#if defined ZMQ_HAVE_WINDOWS
@@ -550,7 +550,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
if (now >= end)
break;
}
errno = ETIMEDOUT;
errno = EAGAIN;
return -1;
#elif defined ZMQ_POLL_BASED_ON_SELECT
@@ -560,7 +560,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
// no event occured within the specified timeout. Otherwise the caller
// needs to check the return value AND the event to avoid using the
// nullified event data.
errno = ETIMEDOUT;
errno = EAGAIN;
if (timeout_ == 0)
return -1;
#if defined ZMQ_HAVE_WINDOWS
@@ -711,7 +711,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
break;
}
errno = ETIMEDOUT;
errno = EAGAIN;
return -1;
#else