Pass null as timeout to select() when infinite timeout is requested
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 @@
     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)) {