diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-05-30 20:17:41 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-05-31 09:38:55 +0200 |
commit | f84ebfdbc64b774b1f00f5b98494e66b8a88fb0b (patch) | |
tree | 82d202833f9be2bb7c7c0162a78b7bd5a1ccc97c /src | |
parent | fdd20b81515427dfd461de61c1e6ad6499d7b13e (diff) |
Properly handle infinite timeout in zmq_poll()
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/xszmq.cpp | 3 |
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) |