diff options
author | Bruno Haible <bruno@clisp.org> | 2020-12-31 23:49:25 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-12-31 23:49:25 +0100 |
commit | ae3a9135fe025f0a4e99f403e57cec09183bbd92 (patch) | |
tree | 0d3df3ad2d2a43147f49bdb58d2a4c639b2ac92f | |
parent | 83734d96bb98304a6611c27163e59aa2eeba492f (diff) | |
download | gnulib-ae3a9135fe025f0a4e99f403e57cec09183bbd92.tar.gz |
poll tests: Avoid test failure on AIX.
* tests/test-poll.c (test_pipe): Disable the "expecting POLLHUP after
shutdown" test on AIX.
* doc/posix-functions/poll.texi: Mention the AIX bug.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | doc/posix-functions/poll.texi | 6 | ||||
-rw-r--r-- | tests/test-poll.c | 7 |
3 files changed, 16 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2020-12-31 Bruno Haible <bruno@clisp.org> + poll tests: Avoid test failure on AIX. + * tests/test-poll.c (test_pipe): Disable the "expecting POLLHUP after + shutdown" test on AIX. + * doc/posix-functions/poll.texi: Mention the AIX bug. + +2020-12-31 Bruno Haible <bruno@clisp.org> + poll tests: Avoid test failure on BSD and Solaris systems. * tests/test-poll.c (test_accept_first, test_socket_pair): Disable the "expecting POLLHUP after shutdown" test on all platforms except Linux. diff --git a/doc/posix-functions/poll.texi b/doc/posix-functions/poll.texi index a04d3b8b18..c1efe87ad9 100644 --- a/doc/posix-functions/poll.texi +++ b/doc/posix-functions/poll.texi @@ -23,8 +23,8 @@ Portability problems not fixed by Gnulib: Under Windows, when passing a pipe, Gnulib's @code{poll} replacement might return 0 even before the timeout has passed. Programs using it with pipes can thus busy wait. - @item -Under HP NonStop, file descriptors other than sockets do not support -POLLHUP; they will return a "readable" status instead. +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. @end itemize diff --git a/tests/test-poll.c b/tests/test-poll.c index 05248d8f8f..5105620ab0 100644 --- a/tests/test-poll.c +++ b/tests/test-poll.c @@ -362,8 +362,13 @@ test_pipe (void) ASSERT (pipe (fd) >= 0); test_pair (fd[0], fd[1]); close (fd[0]); - if ((poll1_wait (fd[1], POLLIN | POLLOUT) & (POLLHUP | POLLERR)) == 0) + int revents = poll1_wait (fd[1], POLLIN | POLLOUT); +#if !defined _AIX + if ((revents & (POLLHUP | POLLERR)) == 0) failed ("expecting POLLHUP after shutdown"); +#else + (void) revents; +#endif close (fd[1]); } |