Files
binutils-gdb/gnulib/patches/0004-select-mingw
Tom Tromey 4324e94471 Import gnulib changes
This imports the gnulib patches that were mentioned by Eli.  I created
the patches from gnulib git, ran them through filterdiff, and then
applied them using update-gnulib.sh's patch-applying facility.

I think the patches are either obviously Windows-specific or harmless,
but I encourage you to look for yourself.

I tested by rebuilding on x86-64 Fedora 34, and also using the Fedora
mingw cross toolchain.
2022-04-25 07:29:02 -06:00

34 lines
1.1 KiB
Plaintext

commit 21fccfa0451ba59fba479e439465da9c360353d3
Author: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu Jul 8 10:00:30 2021 -0700
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.
diff --git a/gnulib/import/select.c b/gnulib/import/select.c
index 2fe6a18064..eddac4b61f 100644
--- a/gnulib/import/select.c
+++ b/gnulib/import/select.c
@@ -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