aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/getaddrinfo.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index ad4923d..a3097f8 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -307,7 +307,7 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
memory allocation failure. The returned string is allocated on the
heap; the caller has to free it. */
static char *
-getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
+getcanonname (nss_action_list nip, struct gaih_addrtuple *at, const char *name)
{
nss_getcanonname_r *cfct = __nss_lookup_function (nip, "getcanonname_r");
char *s = (char *) name;
@@ -538,7 +538,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
struct gaih_addrtuple **pat = &at;
int no_data = 0;
int no_inet6_data = 0;
- service_user *nip;
+ nss_action_list nip;
enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
@@ -720,13 +720,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
}
#endif
- if (__nss_hosts_database == NULL)
- no_more = __nss_database_lookup2 ("hosts", NULL,
- "dns [!UNAVAIL=return] files",
- &__nss_hosts_database);
- else
- no_more = 0;
- nip = __nss_hosts_database;
+ no_more = __nss_database_lookup2 ("hosts", NULL,
+ "dns [!UNAVAIL=return] files",
+ &nip);
/* If we are looking for both IPv4 and IPv6 address we don't
want the lookup functions to automatically promote IPv4
@@ -905,10 +901,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (nss_next_action (nip, status) == NSS_ACTION_RETURN)
break;
- if (nip->next == NULL)
+ nip++;
+ if (nip->module == NULL)
no_more = -1;
- else
- nip = nip->next;
}
__resolv_context_put (res_ctx);