git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 1/4] compat/win32/sys/poll.c: upgrade from upstream

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Sep 29, 2011, 20:59 UTC
Message-ID
<1317329963-6656-2-git-send-email-kusmabite@gmail.com>
In-Reply-To
<1317329963-6656-1-git-send-email-kusmabite@gmail.com>

poll.c is updated from revision adc3a5b in git://git.savannah.gnu.org/gnulib.git

The changes are applied with --whitespace=fix to reduce noise.

poll.h is not upgraded, because the most recent version now contains template-stuff that breaks compilation for us.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
 compat/win32/sys/poll.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/compat/win32/sys/poll.c b/compat/win32/sys/poll.c
index 708a6c9..403eaa7 100644
--- a/compat/win32/sys/poll.c
+++ b/compat/win32/sys/poll.c
@@ -1,7 +1,7 @@
 /* Emulation for poll(2)
    Contributed by Paolo Bonzini.
 
-   Copyright 2001-2003, 2006-2010 Free Software Foundation, Inc.
+   Copyright 2001-2003, 2006-2011 Free Software Foundation, Inc.
 
    This file is part of gnulib.
 
@@ -27,7 +27,10 @@
 #include <malloc.h>
 
 #include <sys/types.h>
-#include "poll.h"
+
+/* Specification.  */
+#include <poll.h>
+
 #include <errno.h>
 #include <limits.h>
 #include <assert.h>
@@ -314,10 +317,7 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
 #endif /* !MinGW */
 
 int
-poll (pfd, nfd, timeout)
-     struct pollfd *pfd;
-     nfds_t nfd;
-     int timeout;
+poll (struct pollfd *pfd, nfds_t nfd, int timeout)
 {
 #ifndef WIN32_NATIVE
   fd_set rfds, wfds, efds;
@@ -454,6 +454,7 @@ poll (pfd, nfd, timeout)
   if (!hEvent)
     hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
 
+restart:
   handle_array[0] = hEvent;
   nhandles = 1;
   FD_ZERO (&rfds);
@@ -594,6 +595,12 @@ poll (pfd, nfd, timeout)
 	rc++;
     }
 
+  if (!rc && timeout == INFTIM)
+    {
+      SwitchToThread();
+      goto restart;
+    }
+
   return rc;
 #endif
 }
-- 
1.7.6.355.g842ba.dirty
Previous: Erik Faye-LundNext: René Scharfe
Message 2 of 15 in “port upload-archive to Windows”
  1. 0/4 port upload-archive to WindowsErik Faye-Lund, Sep 29, 2011
  2. 1/4 compat/win32/sys/poll.c: upgrade from upstreamErik Faye-Lund, Sep 29, 2011
  3. René ScharfeSep 30, 2011
  4. 2/4 mingw: fix compilation of poll-emulationErik Faye-Lund, Sep 29, 2011
  5. 3/4 enter_repo: do not modify inputErik Faye-Lund, Sep 29, 2011
  6. René ScharfeSep 30, 2011
  7. Phil HordOct 4, 2011
  8. Phil HordOct 4, 2011
  9. Erik Faye-LundOct 6, 2011
  10. 4/4 upload-archive: use start_command instead of forkErik Faye-Lund, Sep 29, 2011
  11. Junio C HamanoOct 3, 2011
  12. Erik Faye-LundOct 3, 2011
  13. Junio C HamanoOct 3, 2011
  14. Erik Faye-LundSep 29, 2011
  15. Jeff KingSep 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.