diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-08-05 23:32:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-08-05 23:32:24 +0000 |
commit | 87bb6b6c6bb6d5ff5e5b2a719fa32c77e9898459 (patch) | |
tree | 62536f4dd4680dc660ad8293e9a47ed7249ce4d3 /resolv/nss_dns | |
parent | a79d752f3da1085b4f00ef1a817d8beadcc3014a (diff) | |
download | glibc-87bb6b6c6bb6d5ff5e5b2a719fa32c77e9898459.zip glibc-87bb6b6c6bb6d5ff5e5b2a719fa32c77e9898459.tar.gz glibc-87bb6b6c6bb6d5ff5e5b2a719fa32c77e9898459.tar.bz2 |
Update.
2004-08-04 Jakub Jelinek <jakub@redhat.com>
* hesiod/hesiod.c (__hesiod_res_get): Use calloc instead of malloc +
memset.
(__hesiod_res_set): Free nsaddrs.
* include/resolv.h (__res_maybe_init): Add prototype.
* resolv/resolv.h (struct __res_state): Add _u._ext.initstamp field.
* resolv/Versions (libc): Add __res_maybe_init@@GLIBC_PRIVATE.
* resolv/res_libc.c (__res_initstamp, lock): New variables.
(res_init): Increase __res_initstamp.
(__res_maybe_init): New function.
* resolv/res_init.c (__res_vinit): Initialize _u._ext.initstamp.
* hesiod/hesiod.c (__hesiod_res_get): Use __res_maybe_init instead
of RES_INIT check and {res_ninit,__res_ninit,res_init} call.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r,
_nss_dns_gethostbyaddr_r): Likewise.
* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r,
_nss_dns_getnetbyaddr_r): Likewise.
* resolv/gethnamaddr.c (gethostbyname, gethostbyname2,
gethostbyaddr): Likewise.
* resolv/res_data.c (fp_nquery, res_mkquery, res_mkupdate,
res_isourserver, res_sendsigned, res_update, res_search,
res_querydomain): Likewise.
* nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME)): Likewise.
* nss/digits_dots.c (__nss_hostname_digits_dots): Likewise.
* nss/getnssent_r.c (__nss_setent, __nss_endent, __nss_getent_r):
Likewise.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Set ai_family for
V4-mapped IPv6 addresses and req->ai_family==AF_INET.
Reported by A. Guru <a.guru@sympatico.ca>.
* po/pl.po: Likewise.
characters than necessary.
Diffstat (limited to 'resolv/nss_dns')
-rw-r--r-- | resolv/nss_dns/dns-host.c | 4 | ||||
-rw-r--r-- | resolv/nss_dns/dns-network.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 0424cb9..91699cc 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -145,7 +145,7 @@ _nss_dns_gethostbyname2_r (const char *name, int af, struct hostent *result, int olderr = errno; enum nss_status status; - if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) + if (__res_maybe_init (&_res, 0) == -1) return NSS_STATUS_UNAVAIL; switch (af) { @@ -263,7 +263,7 @@ _nss_dns_gethostbyaddr_r (const void *addr, socklen_t len, int af, int n, status; int olderr = errno; - if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) + if (__res_maybe_init (&_res, 0) == -1) return NSS_STATUS_UNAVAIL; if (af == AF_INET6 && len == IN6ADDRSZ diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c index efda486..a5d2c79 100644 --- a/resolv/nss_dns/dns-network.c +++ b/resolv/nss_dns/dns-network.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004 + Free Software Foundation, Inc. This file is part of the GNU C Library. Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -120,7 +121,7 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result, char *qbuf; enum nss_status status; - if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) + if (__res_maybe_init (&_res, 0) == -1) return NSS_STATUS_UNAVAIL; qbuf = strdupa (name); @@ -171,7 +172,7 @@ _nss_dns_getnetbyaddr_r (uint32_t net, int type, struct netent *result, if (type != AF_INET) return NSS_STATUS_UNAVAIL; - if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) + if (__res_maybe_init (&_res, 0) == -1) return NSS_STATUS_UNAVAIL; net2 = (u_int32_t) net; |