18
18
You should have received a copy of the GNU General Public License along
19
19
with this program; if not, see <http://www.gnu.org/licenses/>. */
20
20
21
+ /* To bump the minimum Windows version to Windows Vista */
22
+ #include "git-compat-util.h"
23
+
21
24
/* Tell gcc not to warn about the (nfd < 0) tests, below. */
22
25
#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__ ) || 4 < __GNUC__
23
26
# pragma GCC diagnostic ignored "-Wtype-limits"
@@ -449,7 +452,8 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
449
452
static HANDLE hEvent ;
450
453
WSANETWORKEVENTS ev ;
451
454
HANDLE h , handle_array [FD_SETSIZE + 2 ];
452
- DWORD ret , wait_timeout , nhandles , start = 0 , elapsed , orig_timeout = 0 ;
455
+ DWORD ret , wait_timeout , nhandles , orig_timeout = 0 ;
456
+ ULONGLONG start = 0 ;
453
457
fd_set rfds , wfds , xfds ;
454
458
BOOL poll_again ;
455
459
MSG msg ;
@@ -465,7 +469,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
465
469
if (timeout != INFTIM )
466
470
{
467
471
orig_timeout = timeout ;
468
- start = GetTickCount ();
472
+ start = GetTickCount64 ();
469
473
}
470
474
471
475
if (!hEvent )
@@ -614,8 +618,8 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
614
618
615
619
if (!rc && orig_timeout && timeout != INFTIM )
616
620
{
617
- elapsed = GetTickCount () - start ;
618
- timeout = elapsed >= orig_timeout ? 0 : orig_timeout - elapsed ;
621
+ ULONGLONG elapsed = GetTickCount64 () - start ;
622
+ timeout = elapsed >= orig_timeout ? 0 : ( int )( orig_timeout - elapsed ) ;
619
623
}
620
624
621
625
if (!rc && timeout )
0 commit comments