On Cygwin 3.4.6 and older, but not on Cygwin 3.5.3, I see this test failure:

FAIL: test-poll.exe

This patch works around it, like we already did for AIX and native Windows.


2024-05-23  Bruno Haible  <br...@clisp.org>

        poll tests: Avoid test failure on Cygwin.
        * tests/test-poll.c (test_pipe): Disable the POLLHUP check also on
        Cygwin.
        * doc/posix-functions/poll.texi: Mention also Cygwin w.r.t. POLLHUP.

diff --git a/doc/posix-functions/poll.texi b/doc/posix-functions/poll.texi
index ab7083c1c0..df2c19a900 100644
--- a/doc/posix-functions/poll.texi
+++ b/doc/posix-functions/poll.texi
@@ -26,5 +26,5 @@
 @item
 On some platforms, file descriptors other than sockets do not support
 POLLHUP; they will return a "readable" or "writable" status instead:
-AIX 7.2, HP NonStop, mingw, MSVC.
+AIX 7.2, Cygwin 3.4.6, HP NonStop, mingw, MSVC.
 @end itemize
diff --git a/tests/test-poll.c b/tests/test-poll.c
index 0f89694819..58cd87cfb5 100644
--- a/tests/test-poll.c
+++ b/tests/test-poll.c
@@ -362,7 +362,7 @@ test_pipe (void)
   test_pair (fd[0], fd[1]);
   close (fd[0]);
   int revents = poll1_wait (fd[1], POLLIN | POLLOUT);
-#if !(defined _AIX || (defined _WIN32 && !defined __CYGWIN__))
+#if !(defined _AIX || defined __CYGWIN__ || (defined _WIN32 && !defined 
__CYGWIN__))
   if ((revents & (POLLHUP | POLLERR)) == 0)
     failed ("expecting POLLHUP after shutdown");
 #else




Reply via email to