Similarly to commit
a008d625 which fixed the obvious
problem with isatty(), also apply the fix to the
select() and poll() MS-Windows implementations.
lib/poll.c (IsConsoleHandle): Change from testing the lower
2 bits of the handle to the more expensive but accurate syscall.
lib/select.c: Likewise.
+2014-06-10 Pádraig Brady <P@draigBrady.com>
+
+ select,poll: fix console handle check on windows 8
+ lib/poll.c (IsConsoleHandle): Change from testing the lower
+ 2 bits of the handle to the more expensive but accurate syscall.
+ lib/select.c: Likewise.
+
2014-06-10 Eli Zaretskii <eliz@gnu.org>
select: fix waiting on anonymous pipes on MS-Windows
#ifdef WINDOWS_NATIVE
-/* Optimized test whether a HANDLE refers to a console.
- See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>. */
-#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
+static BOOL IsConsoleHandle (HANDLE h)
+{
+ DWORD mode;
+ return GetConsoleMode (h, &mode) != 0;
+}
static BOOL
IsSocketHandle (HANDLE h)
#define PIPE_BUF 512
#endif
-/* Optimized test whether a HANDLE refers to a console.
- See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>. */
-#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
+static BOOL IsConsoleHandle (HANDLE h)
+{
+ DWORD mode;
+ return GetConsoleMode (h, &mode) != 0;
+}
static BOOL
IsSocketHandle (HANDLE h)