From 702f73cc8420b7b47d098f5261711df6f9cb28ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Sun, 4 Apr 2021 19:17:34 -0400 Subject: [PATCH] Add nfds_t required by poll(), and add note describing Win32 bug --- src/xpdev/sockwrap.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xpdev/sockwrap.h b/src/xpdev/sockwrap.h index 64481c2f5e..411824df2c 100644 --- a/src/xpdev/sockwrap.h +++ b/src/xpdev/sockwrap.h @@ -173,6 +173,12 @@ static int wsa_error; #define ERROR_VALUE ((wsa_error=WSAGetLastError())>0 ? wsa_error-WSABASEERR : wsa_error) #define socket_errno WSAGetLastError() #define sendsocket(s,b,l) send(s,b,l,0) +typedef ULONG nfds_t; +/* + * NOTE: WSAPoll() has a bug where a non-blocking socket which has connect() + * called on it that is trying to connect to a closed port will timeout + * instead of returning a failure, even with POLLOUT specified. + */ #define poll(s, c, t) WSAPoll(s, c, t) /* For getaddrinfo() */ -- GitLab