From 8c8fbab31d989ee42b7781d0720291d6443d70d3 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 17 Apr 2002 12:34:36 +0000 Subject: Patch from Mike McDonald to make gethostbyname_r() not fail for things like gethostbyname("192.168.0.1"), which should work even when the /etc/hosts and /etc/config/hosts files do not exist. --- libc/inet/resolv.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libc/inet') diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index ae99ea068..fa7ba37fe 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1578,6 +1578,11 @@ int gethostbyname_r(const char * name, case HOST_NOT_FOUND: case NO_ADDRESS: break; + case NETDB_INTERNAL: + if (errno == ENOENT) { + break; + } + /* else fall through */ default: return i; } -- cgit v1.2.3