summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Nowak <maciejt.nowak@gmail.com>2019-05-24 17:42:44 +0200
committerGarrett D'Amore <garrett@damore.org>2019-06-09 11:16:56 -0700
commit53d13b3bae361127d10335240022ec230758a7ae (patch)
tree2b5662c359286727f1f079a96f00ebd68868a1f6
parentf861a7c72bc90fb1f18ffeb2f2a3d1fa59dbc5dd (diff)
downloadnanomsg-53d13b3bae361127d10335240022ec230758a7ae.tar.gz
Pass null as timeout to select() when infinite timeout is requested
-rw-r--r--src/core/poll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/poll.c b/src/core/poll.c
index 6aa3029..acce8ee 100644
--- a/src/core/poll.c
+++ b/src/core/poll.c
@@ -66,7 +66,7 @@ int nn_poll (struct nn_pollfd *fds, int nfds, int timeout)
tv.tv_sec = timeout / 1000;
tv.tv_usec = timeout % 1000 * 1000;
if (nn_fast (nfds)) {
- rc = select (-1, &fdset, NULL, NULL, &tv);
+ rc = select (-1, &fdset, NULL, NULL, timeout == -1 ? NULL : &tv);
if (nn_slow (rc == 0))
return 0;
if (nn_slow (rc == SOCKET_ERROR)) {