From 1ed934d0d08bf9c3f460e8740d169e7606f8702f Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 27 May 2013 17:31:01 +0000 Subject: Add minimal support for _res setup and update. Change res_init() to initialize the _res structure on first call, and udpate the global async context if changes were made by the user. All resolver functions now call res_init() internally. fixes issue spotted by otto@ --- lib/libc/asr/getaddrinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc/asr/getaddrinfo.c') diff --git a/lib/libc/asr/getaddrinfo.c b/lib/libc/asr/getaddrinfo.c index 84b11ce5b80..9e8ba91c5b2 100644 --- a/lib/libc/asr/getaddrinfo.c +++ b/lib/libc/asr/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getaddrinfo.c,v 1.1 2012/09/08 11:08:21 eric Exp $ */ +/* $OpenBSD: getaddrinfo.c,v 1.2 2013/05/27 17:31:01 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -31,6 +31,8 @@ getaddrinfo(const char *hostname, const char *servname, struct async_res ar; int saved_errno = errno; + res_init(); + as = getaddrinfo_async(hostname, servname, hints, NULL); if (as == NULL) { if (errno == ENOMEM) { -- cgit v1.2.3-59-g8ed1b