Skip to content

Commit

Permalink
* nss/getnssent_r.c (__nss_getent_r): Return ENOENT if status is
Browse files Browse the repository at this point in the history
	neither SUCCESS nor TRYAGAIN (see 2002-08-25 change [PR libc/4259]).

	* nss/getnssent_r.c (__nss_getent_r): Set *H_ERRNOP, not global one.
  • Loading branch information
Roland McGrath committed Aug 31, 2002
1 parent e932b40 commit 8fea756
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2002-08-30 Roland McGrath <roland@redhat.com>

* nss/getnssent_r.c (__nss_getent_r): Return ENOENT if status is
neither SUCCESS nor TRYAGAIN (see 2002-08-25 change [PR libc/4259]).

* nss/getnssent_r.c (__nss_getent_r): Set *H_ERRNOP, not global one.

* sysdeps/x86_64/hp-timing.h (HP_TIMING_NOW, HP_TIMING_ACCUM): New
macros replace the i686 versions for 64-bit mode.

Expand Down
9 changes: 5 additions & 4 deletions nss/getnssent_r.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
/* Copyright (C) 2000,02 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -71,7 +71,7 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct,
{
int is_last_nip = *nip == *last_nip;
enum nss_status status;

if (stayopen_tmp)
status = DL_CALL_FCT (fct, (*stayopen_tmp));
else
Expand Down Expand Up @@ -136,7 +136,7 @@ __nss_getent_r (const char *getent_func_name,
if (res && (_res.options & RES_INIT) == 0
&& __res_ninit (&_res) == -1)
{
__set_h_errno (NETDB_INTERNAL);
*h_errnop = NETDB_INTERNAL;
*result = NULL;
return errno;
}
Expand Down Expand Up @@ -197,5 +197,6 @@ __nss_getent_r (const char *getent_func_name,
}

*result = status == NSS_STATUS_SUCCESS ? resbuf : NULL;
return status == NSS_STATUS_SUCCESS ? 0 : errno;
return (status == NSS_STATUS_SUCCESS
? 0 : status == NSS_STATUS_TRYAGAIN ? errno : ENOENT);
}

0 comments on commit 8fea756

Please sign in to comment.