]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- fast-reload, fix use of WSAPoll.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 18 Mar 2025 13:40:19 +0000 (14:40 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 18 Mar 2025 13:40:19 +0000 (14:40 +0100)
daemon/remote.c

index 45a7ada97027c590f75a91368715ac1fbdd9d877..d231f6eab68e61634ee3eca1a2654aaebd85db8a 100644 (file)
@@ -3896,7 +3896,11 @@ sock_poll_timeout(int fd, int timeout, int pollin, int pollout, int* event)
                        nfds = 1;
                        memset(&p, 0, sizeof(p));
                        p.fd = fd;
-                       p.events = POLLERR | POLLHUP;
+                       p.events = POLLERR
+#ifndef USE_WINSOCK
+                               | POLLHUP
+#endif
+                               ;
                        if(pollin)
                                p.events |= POLLIN;
                        if(pollout)
@@ -3905,7 +3909,12 @@ sock_poll_timeout(int fd, int timeout, int pollin, int pollout, int* event)
 #ifndef USE_WINSOCK
                ret = poll(fds, nfds, timeout);
 #else
-               ret = WSAPoll(fds, nfds, timeout);
+               if(fds == NULL) {
+                       Sleep(timeout);
+                       ret = 0;
+               } else {
+                       ret = WSAPoll(fds, nfds, timeout);
+               }
 #endif
                if(ret == -1) {
                        if(