commit | 53d13b3bae361127d10335240022ec230758a7ae | [log] [tgz] |
---|---|---|
author | Maciej Nowak <maciejt.nowak@gmail.com> | Fri May 24 17:42:44 2019 +0200 |
committer | Garrett D'Amore <garrett@damore.org> | Sun Jun 09 11:16:56 2019 -0700 |
tree | 2b5662c359286727f1f079a96f00ebd68868a1f6 | |
parent | f861a7c72bc90fb1f18ffeb2f2a3d1fa59dbc5dd [diff] |
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)) {