From bd07baf0281ddb5f332bd03b06038fc0ac048285 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 9 Jan 2010 22:24:59 +0100 Subject: ZMQII-33: zmq_poll may exceed timeout if signal interrupts the waiting --- src/zmq.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zmq.cpp b/src/zmq.cpp index 689a1e7..03064bc 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -334,7 +334,7 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) // already be signaled on 0MQ sockets. int rc = poll (pollfds, npollfds, initial ? 0 : timeout); if (rc == -1 && errno == EINTR) - continue; + break; errno_assert (rc >= 0); // If timeout was hit with no events signaled, return zero. @@ -453,7 +453,7 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) wsa_assert (rc != SOCKET_ERROR); #else if (rc == -1 && errno == EINTR) - continue; + break; #endif errno_assert (rc >= 0); -- cgit v1.2.3