From f84ebfdbc64b774b1f00f5b98494e66b8a88fb0b Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 30 May 2012 20:17:41 +0200 Subject: Properly handle infinite timeout in zmq_poll() Signed-off-by: Martin Sustrik --- src/xszmq.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3