Skip to content

Commit

Permalink
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init
Browse files Browse the repository at this point in the history
	if necessary.
  • Loading branch information
Ulrich Drepper committed May 14, 2008
1 parent 18a7415 commit 1f03982
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2008-05-14 Ulrich Drepper <drepper@redhat.com>

* sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init
if necessary.

* sysdeps/posix/getaddrinfo.c: Implement handling of DCCP, UDPlite,
and SCTP.

Expand Down
5 changes: 5 additions & 0 deletions sysdeps/posix/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1f03982

Please sign in to comment.