From 4a5af3d0cc85bb4ddac292cd4d2709ad2f83c1eb Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Fri, 27 Oct 2000 12:34:52 +0000 Subject: [PATCH] Make RES_OPTIONS=inet6 work. Basically PR22196, but slightly modified. PR: bin/22196 --- lib/libc/net/gethostnamadr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index fcfc9791a909..d5644a845c50 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -61,6 +61,10 @@ gethostbyname(const char *name) { struct hostent *hp; + if ((_res.options & RES_INIT) == 0 && res_init() == -1) { + h_errno = NETDB_INTERNAL; + return (NULL); + } if (_res.options & RES_USE_INET6) { /* XXX */ hp = gethostbyname2(name, AF_INET6); /* XXX */ if (hp) /* XXX */