From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4526 invoked by alias); 29 Mar 2004 20:16:58 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 4500 invoked from network); 29 Mar 2004 20:16:57 -0000 Received: from unknown (HELO myware.akkadia.org) (24.221.190.179) by sources.redhat.com with SMTP; 29 Mar 2004 20:16:57 -0000 Received: from redhat.com (drepper@myware.akkadia.org [192.168.7.70]) (authenticated bits=0) by myware.akkadia.org (8.12.11/8.12.10) with ESMTP id i2TKGIZW005637; Mon, 29 Mar 2004 12:16:19 -0800 Message-ID: <40688412.9020907@redhat.com> Date: Tue, 30 Mar 2004 00:01:00 -0000 From: Ulrich Drepper Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040328 MIME-Version: 1.0 To: Thorsten Kukuk CC: libc-hacker@sources.redhat.com Subject: Re: NSS modules and errno if key not found References: <20040326221341.GA14167@suse.de> <20040327175122.GA21826@suse.de> In-Reply-To: <20040327175122.GA21826@suse.de> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-03/txt/msg00141.txt.bz2 Thorsten Kukuk wrote: > * nss/getXXbyYY_r.c: If key is not found, return zero, not > a random errno value. > > --- nss/getXXbyYY_r.c 10 Mar 2004 09:28:25 -0000 1.57 > +++ nss/getXXbyYY_r.c 27 Mar 2004 08:44:52 -0000 > @@ -256,6 +256,11 @@ > else if (status == NSS_STATUS_TRYAGAIN && *h_errnop != NETDB_INTERNAL) > res = EAGAIN; > #endif > + else if (status == NSS_STATUS_NOTFOUND) > + { > + __set_errno (ENOENT); > + return 0; > + } That's not really necessary, errno need not be set. But since we always do it for some compatibility reason it is OK. But your patch is not optimal, take a look at the change I've checked in. -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖