From patchwork Mon Jun 27 10:48:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 55439 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B657383EC57 for ; Mon, 27 Jun 2022 10:49:58 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 8BCA538425BC for ; Mon, 27 Jun 2022 10:48:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8BCA538425BC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 8CEBE30005B6; Mon, 27 Jun 2022 12:48:39 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 330D14000C41; Mon, 27 Jun 2022 12:48:39 +0200 (CEST) From: Mark Wielaard To: libc-alpha@sourceware.org Subject: [PATCHv2] time/tst-clock2.c: clock_settime CLOCK_MONOTONIC might return EPERM Date: Mon, 27 Jun 2022 12:48:26 +0200 Message-Id: <20220627104826.4303-1-mark@klomp.org> X-Mailer: git-send-email 2.18.4 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Wielaard Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" clock_settime can return errno EPERM if it does not have permission to set the clock indicated. The test expects setting the monotonic clock must fail. Which it does. But the errno can be either EINVAL or EPERM. --- v2: add %m and split too long printf line. https://code.wildebeest.org/git/user/mjw/glibc/commit/?h=container-perms&id=d90b0d2ac7cb14d035d2ade47ca1115486888b63 time/tst-clock2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/time/tst-clock2.c b/time/tst-clock2.c index 4c8fb9f247..fd052f13ec 100644 --- a/time/tst-clock2.c +++ b/time/tst-clock2.c @@ -27,10 +27,10 @@ do_test (void) puts ("clock_settime(CLOCK_MONOTONIC) did not fail"); return 1; } - if (errno != EINVAL) + if (errno != EINVAL && errno != EPERM) { - printf ("clock_settime(CLOCK_MONOTONIC) set errno to %d, expected %d\n", - errno, EINVAL); + printf ("clock_settime(CLOCK_MONOTONIC) set errno to %d (%m)," + " expected %d or %d\n", errno, EINVAL, EPERM); return 1; } return 0;