From fd71cb2f9c2ca15e81c9a314872737c2bed645b0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 23 May 2024 16:25:01 +0200 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ doc/posix-functions/poll.texi | 2 +- tests/test-poll.c | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebbe06fe73..672ce3f726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-05-23 Bruno Haible + + 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 renameatu: Work around Cygwin 3.4.6 bug. 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 @@ 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 diff --git a/tests/test-poll.c b/tests/test-poll.c index f34f7f460a..8c1d5d6bb0 100644 --- a/tests/test-poll.c +++ b/tests/test-poll.c @@ -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 -- 2.39.5