Merge branch 'jc/upload-pack-send-symref'
[gitweb.git] / compat / poll / poll.c
index 7d226ecb293ee3c5f9b17aa3e5e36b7c8701dbae..31163f2ae7b71857889f561dea0b3ffecff61989 100644 (file)
@@ -39,7 +39,7 @@
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # define WIN32_NATIVE
-# if defined (_MSC_VER)
+# if defined (_MSC_VER) && !defined(_WIN32_WINNT)
 #  define _WIN32_WINNT 0x0502
 # endif
 # include <winsock2.h>
@@ -576,7 +576,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
        {
          /* It's a socket.  */
          WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
-         WSAEventSelect ((SOCKET) h, 0, 0);
+         WSAEventSelect ((SOCKET) h, NULL, 0);
 
          /* If we're lucky, WSAEnumNetworkEvents already provided a way
             to distinguish FD_READ and FD_ACCEPT; this saves a recv later.  */