aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/poll.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/win32/poll.c b/win32/poll.c
index fb95adea7..8ab6bbf29 100644
--- a/win32/poll.c
+++ b/win32/poll.c
@@ -1,7 +1,7 @@
1/* Emulation for poll(2) 1/* Emulation for poll(2)
2 Contributed by Paolo Bonzini. 2 Contributed by Paolo Bonzini.
3 3
4 Copyright 2001-2003, 2006-2022 Free Software Foundation, Inc. 4 Copyright 2001-2003, 2006-2024 Free Software Foundation, Inc.
5 5
6 This file is part of gnulib. 6 This file is part of gnulib.
7 7
@@ -407,14 +407,15 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
407 if (timeout == 0) 407 if (timeout == 0)
408 { 408 {
409 ptv = &tv; 409 ptv = &tv;
410 ptv->tv_sec = 0; 410 tv = (struct timeval) {0};
411 ptv->tv_usec = 0;
412 } 411 }
413 else if (timeout > 0) 412 else if (timeout > 0)
414 { 413 {
415 ptv = &tv; 414 ptv = &tv;
416 ptv->tv_sec = timeout / 1000; 415 tv = (struct timeval) {
417 ptv->tv_usec = (timeout % 1000) * 1000; 416 .tv_sec = timeout / 1000,
417 .tv_usec = (timeout % 1000) * 1000
418 };
418 } 419 }
419 else if (timeout == INFTIM) 420 else if (timeout == INFTIM)
420 /* wait forever */ 421 /* wait forever */