From patchwork Sun Jun 26 20:59:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 55416 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 151B9385040D for ; Sun, 26 Jun 2022 21:10:54 +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 D98B63850402 for ; Sun, 26 Jun 2022 21:10:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D98B63850402 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 reform (deer0x0e.wildebeest.org [172.31.17.144]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id CD15930005B6; Sun, 26 Jun 2022 23:10:27 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 8E8BF2E83468; Sun, 26 Jun 2022 23:10:27 +0200 (CEST) From: Mark Wielaard To: libc-alpha@sourceware.org Subject: [PATCH 1/4] time/tst-clock2.c: clock_settime CLOCK_MONOTONIC might return EPERM Date: Sun, 26 Jun 2022 22:59:12 +0200 Message-Id: <20220626205915.33201-2-mark@klomp.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220626205915.33201-1-mark@klomp.org> References: <20220626205915.33201-1-mark@klomp.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 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. --- 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..3f46220832 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, expected %d or %d\n", + errno, EINVAL, EPERM); return 1; } return 0;