Hi Daniel,
> it does not actually make poll() function correctly. We're still passing
> HANDLE objects to the rpl_select() method, instead of calling
> the native select() method.
I don't agree with your reasoning. The select() calls in lib/poll.c:511 and
lib/poll.c:547 is not passing a HANDLE, rather it passes bit masks of FDs
that correspond to SOCKETs. Therefore I propose this patch:
diff --git a/lib/poll.c b/lib/poll.c
index c4b2127..2c6e879 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -80,6 +80,14 @@
first argument, not any possible gnulib override. */
# undef recv
+/* Here it does not matter whether we use the select() function from Windows,
+ that works only when all indicated FDs correspond to sockets and that
+ returns its error code in WSAGetLastError(), or the gnulib override that
+ does not have this limitation and that returns its error code in errno.
+ To simplify testing, use the lower-level Windows select() function
+ always. */
+# undef select
+
static BOOL IsConsoleHandle (HANDLE h)
{
DWORD mode;