From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id AA7823857C48 for ; Sun, 26 Jun 2022 21:15:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA7823857C48 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=50173 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1o5Zbc-00Df9P-29; Sun, 26 Jun 2022 21:15:44 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1o5Zbb-0008ya-Nb; Sun, 26 Jun 2022 23:15:43 +0200 From: Florian Weimer To: Mark Wielaard Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 1/4] time/tst-clock2.c: clock_settime CLOCK_MONOTONIC might return EPERM References: <20220626205915.33201-1-mark@klomp.org> <20220626205915.33201-2-mark@klomp.org> Date: Sun, 26 Jun 2022 23:15:43 +0200 In-Reply-To: <20220626205915.33201-2-mark@klomp.org> (Mark Wielaard's message of "Sun, 26 Jun 2022 22:59:12 +0200") Message-ID: <87pmivnn28.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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: , X-List-Received-Date: Sun, 26 Jun 2022 21:15:46 -0000 * Mark Wielaard: > 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; You could use "errno to %d (%#m)" if you are changing this line anyway. And isn't the line too long? Direction looks okay to me.