summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2010-01-09 22:24:59 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2010-01-09 22:24:59 +0100
commitbd07baf0281ddb5f332bd03b06038fc0ac048285 (patch)
treecfaff3ddbae98d05de4b5f3d14e355f77dcf38ae /src
parente806615dd18e625b0b7fb1074cc4da5fda18529b (diff)
ZMQII-33: zmq_poll may exceed timeout if signal interrupts the waiting
Diffstat (limited to 'src')
-rw-r--r--src/zmq.cpp4
1 files 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);