From patchwork Tue Apr 12 09:44:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1616126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kd17P5q55z9sGF for ; Tue, 12 Apr 2022 19:45:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6754E3857349 for ; Tue, 12 Apr 2022 09:45:51 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 6EA133857363 for ; Tue, 12 Apr 2022 09:44:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6EA133857363 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 25FED20148; Tue, 12 Apr 2022 11:44:55 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yk0-9yg3WWQR; Tue, 12 Apr 2022 11:44:55 +0200 (CEST) Received: from begin (nat-inria-interne-52-gw-01-bso.bordeaux.inria.fr [194.199.1.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 0FCD320147; Tue, 12 Apr 2022 11:44:55 +0200 (CEST) Received: from samy by begin with local (Exim 4.95) (envelope-from ) id 1neD4g-009SSw-OY; Tue, 12 Apr 2022 11:44:38 +0200 Date: Tue, 12 Apr 2022 11:44:34 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org, Florian Weimer Subject: [PATCH,hurd] Fix arbitrary error code Message-ID: <20220412094434.nqpydlozpprrkg6r@begin> MIME-Version: 1.0 Content-Disposition: inline Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" ELIBBAD is Linux-specific, Hurd has EGRATUITOUS instead. diff --git a/nss/nss_test_errno.c b/nss/nss_test_errno.c index 680f8a07b9..d27368f4f3 100644 --- a/nss/nss_test_errno.c +++ b/nss/nss_test_errno.c @@ -28,7 +28,13 @@ static void __attribute__ ((constructor)) init (void) { /* An arbitrary error code which is otherwise not used. */ +#if defined(__linux__) errno = ELIBBAD; +#elif defined(__GNU__) + errno = EGRATUITOUS; +#else +#error missing arbitrary error code +#endif } /* Lookup functions for pwd follow that do not return any data. */