]> Savannah Git Hosting - gnulib.git/commitdiff
select: port better to MinGW
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Jul 2021 17:00:30 +0000 (10:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 8 Jul 2021 17:00:30 +0000 (10:00 -0700)
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/bug-gnulib/2021-07/msg00017.html
* lib/select.c (rpl_select) [_WIN32 && !__CYGWIN__]:
Pass a SOCKET, not a HANDLE, to FD_ISSET.

ChangeLog
lib/select.c

index 2eaf00b59174403b481a3a9776ee7b468a0d042d..25d85aa4afae8adf14c5e096d4909c8efafe7af5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-07-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       select: port better to MinGW
+       Problem reported by Eli Zaretskii in:
+       https://lists.gnu.org/r/bug-gnulib/2021-07/msg00017.html
+       * lib/select.c (rpl_select) [_WIN32 && !__CYGWIN__]:
+       Pass a SOCKET, not a HANDLE, to FD_ISSET.
+
 2021-07-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        year2038: Add --disable-year2038 option
index 2fe6a18064dbda93c8ac0acb9a4c9c3f355ceb5f..eddac4b61f142b5b97f1adbe3259bfd2984a1444 100644 (file)
@@ -530,12 +530,13 @@ restart:
       if (h != handle_array[nhandles])
         {
           /* Perform handle->descriptor mapping.  */
-          WSAEventSelect ((SOCKET) h, NULL, 0);
-          if (FD_ISSET (h, &handle_rfds))
+          SOCKET s = (SOCKET) h;
+          WSAEventSelect (s, NULL, 0);
+          if (FD_ISSET (s, &handle_rfds))
             FD_SET (i, rfds);
-          if (FD_ISSET (h, &handle_wfds))
+          if (FD_ISSET (s, &handle_wfds))
             FD_SET (i, wfds);
-          if (FD_ISSET (h, &handle_xfds))
+          if (FD_ISSET (s, &handle_xfds))
             FD_SET (i, xfds);
         }
       else