From: Ulrich Drepper Date: Wed, 14 May 2008 21:53:48 +0000 (+0000) Subject: * sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init X-Git-Tag: cvs/fedora-glibc-20080515T0735~10 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1f0398248c1c581a1203c0d294acde295b949fea;p=glibc.git * sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init if necessary. --- diff --git a/ChangeLog b/ChangeLog index aa1cbdcab8..5a06103bef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-05-14 Ulrich Drepper + * sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init + if necessary. + * sysdeps/posix/getaddrinfo.c: Implement handling of DCCP, UDPlite, and SCTP. diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 0ae43938f8..c8965ef99d 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 #include #include +#include #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;