From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 333AE1F4B4 for ; Thu, 31 Dec 2020 23:03:05 +0000 (UTC) Received: from localhost ([::1]:56012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kv6yF-00020j-T8 for normalperson@yhbt.net; Thu, 31 Dec 2020 18:03:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kv6qA-0000Nu-9l for bug-gnulib@gnu.org; Thu, 31 Dec 2020 17:54:42 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]:20407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kv6pf-00080D-LZ for bug-gnulib@gnu.org; Thu, 31 Dec 2020 17:54:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1609455248; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:From:Subject: Sender; bh=lnjFBsRgC4V+oHSBchSKMRvLep8d+4nKLz6UaIp2sJY=; b=qBB8QKZymBRKQsNxFaX5juJE/adWVcSllvaRhmasF0DxrnQS8N4lb6MNrMtoCIREw2 xfps+x9ny36qhxVRyJmhUytSkhh+1jbIwL708cb5tlEsH0B1xALsQBljd7+dvCWpaN6s ngRAxz1MBh4dkh8OqSFRHZ4sPbbnYfw7h7IkDyMbU/F+sQS8tENq4ovboItBB/SPwMZN 5j29/9XmXt+KaPzk8Pr27TtujTNJTq51TjQ5EhE9/a4f8tQrlJcTnyGXd9kKgk0sv+lo Mr4Lxnoq2NQIpBLMLk/07gL4Ege7eJXyLramxP8d1ZNneMxDuo8Dk2yrvBAIt3l91cnM A7qg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6f3z/s=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.10.7 DYNA|AUTH) with ESMTPSA id e012d5wBVMs8WZ8 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Thu, 31 Dec 2020 23:54:08 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: poll tests: Avoid test failure on AIX Date: Thu, 31 Dec 2020 23:54:07 +0100 Message-ID: <1622170.KMc9KUrPTa@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <6145955.M0qUDR3Ujj@omega> References: <6145955.M0qUDR3Ujj@omega> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.217; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Another POLLHUP test is failing on AIX, but here not for the sockets, but for the pipes. This is an AIX bug w.r.t. POSIX. Since we cannot easily work around it in Gnulib, this patch - documents it, - avoids a test failure (since I don't want to see it over and over again, now that it's documented). 2020-12-31 Bruno Haible 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. diff --git a/doc/posix-functions/poll.texi b/doc/posix-functions/poll.texi index a04d3b8..c1efe87 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 05248d8..5105620 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]); }