summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 5774d0c503..bcf4bd77ea 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2157,6 +2157,9 @@ do_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
static inline int
subtract(struct timeval *rest, const struct timeval *wait)
{
+ if (rest->tv_sec < wait->tv_sec) {
+ return 0;
+ }
while (rest->tv_usec < wait->tv_usec) {
if (rest->tv_sec <= wait->tv_sec) {
return 0;