summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-05-30 20:17:41 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-05-31 09:38:55 +0200
commitf84ebfdbc64b774b1f00f5b98494e66b8a88fb0b (patch)
tree82d202833f9be2bb7c7c0162a78b7bd5a1ccc97c
parentfdd20b81515427dfd461de61c1e6ad6499d7b13e (diff)
Properly handle infinite timeout in zmq_poll()
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--src/xszmq.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xszmq.cpp b/src/xszmq.cpp
index 21db52c..d54920b 100644
--- a/src/xszmq.cpp
+++ b/src/xszmq.cpp
@@ -379,7 +379,8 @@ int zmq_recv (void *s, zmq_msg_t *msg, int flags)
int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout)
{
- return xs_poll ((xs_pollitem_t*) items, nitems, (int) (timeout / 1000));
+ return xs_poll ((xs_pollitem_t*) items, nitems,
+ timeout < 0 ? -1 : (int) (timeout / 1000));
}
int zmq_device (int device, void *frontend, void *backend)