mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-16 07:23:46 +02:00
Problem: waiting on an empty poller with infinite timeout waits forever
Solution: return EFAULT when such an operation is attempted
This commit is contained in:
@@ -400,6 +400,11 @@ int zmq::socket_poller_t::rebuild ()
|
||||
|
||||
int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_events_, long timeout_)
|
||||
{
|
||||
if (items.empty () && timeout_ < 0) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (need_rebuild)
|
||||
if (rebuild () == -1)
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user