public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Thorsten Kukuk <kukuk@suse.de>
Cc: libc-hacker@sources.redhat.com
Subject: Re: NSS modules and errno if key not found
Date: Tue, 30 Mar 2004 00:01:00 -0000	[thread overview]
Message-ID: <40688412.9020907@redhat.com> (raw)
In-Reply-To: <20040327175122.GA21826@suse.de>

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 ❖

      reply	other threads:[~2004-03-29 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-27 17:53 Thorsten Kukuk
2004-03-29 20:16 ` Thorsten Kukuk
2004-03-30  0:01   ` Ulrich Drepper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40688412.9020907@redhat.com \
    --to=drepper@redhat.com \
    --cc=kukuk@suse.de \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).