]> Savannah Git Hosting - gnulib.git/commitdiff
poll tests: Avoid test failure on Cygwin.
authorBruno Haible <bruno@clisp.org>
Thu, 23 May 2024 14:25:01 +0000 (16:25 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 31 May 2024 21:44:38 +0000 (23:44 +0200)
* 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.

ChangeLog
doc/posix-functions/poll.texi
tests/test-poll.c

index ebbe06fe7378e896434eee86cd835ca273f26291..672ce3f7266428d145e409569f3279f4f01c3640 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-23  Bruno Haible  <bruno@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.
+
 2024-05-23  Bruno Haible  <bruno@clisp.org>
 
        renameatu: Work around Cygwin 3.4.6 bug.
index ab7083c1c0233d90e1dfb09e8f7de6218b80a1fd..df2c19a900920bfc994fa24854b5d01186ee4cc9 100644 (file)
@@ -26,5 +26,5 @@ thus busy wait.
 @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
index f34f7f460a7f565016c0faec9148065b767bac1c..8c1d5d6bb08c7c8101578d4506fd503b32af788f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of poll() function.
-   Copyright (C) 2008-2023 Free Software Foundation, Inc.
+   Copyright (C) 2008-2024 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -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