aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-14 21:53:48 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-14 21:53:48 +0000
commit1f0398248c1c581a1203c0d294acde295b949fea (patch)
treeadc03728e334fe2f5a2954c9358e21f03cef8745 /sysdeps/posix
parent18a74157a6048c4ff7156b9f45ca9e19c114dc4f (diff)
downloadglibc-1f0398248c1c581a1203c0d294acde295b949fea.zip
glibc-1f0398248c1c581a1203c0d294acde295b949fea.tar.gz
glibc-1f0398248c1c581a1203c0d294acde295b949fea.tar.bz2
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init
if necessary.
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getaddrinfo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 0ae4393..c8965ef 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -61,6 +61,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <not-cancel.h>
#include <nscd/nscd-client.h>
#include <nscd/nscd_proto.h>
+#include <resolv/res_hconf.h>
#ifdef HAVE_LIBIDN
extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
@@ -2089,6 +2090,10 @@ getaddrinfo (const char *name, const char *service,
if ((hints->ai_flags & AI_CANONNAME) && name == NULL)
return EAI_BADFLAGS;
+ /* Initialize configurations. */
+ if (__builtin_expect (!_res_hconf.initialized, 0))
+ _res_hconf_init ();
+
struct in6addrinfo *in6ai = NULL;
size_t in6ailen = 0;
bool seen_ipv4 = false;