Merge branch 'jk/diff-tree-t-fix'
[gitweb.git] / compat / poll / poll.c
index 44103103a4a71ff25e5e8e1d106221a9dd2e9908..a9b41d89f465208b6f0e417672077403bf30898f 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>
@@ -605,7 +605,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
 
   if (!rc && timeout == INFTIM)
     {
-      SwitchToThread();
+      SleepEx (1, TRUE);
       goto restart;
     }