From 40f8f5f0336ddcd6f7ea2d45d4713b553a225843 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 20 Oct 2011 18:49:48 +0200 Subject: gethostbyname_r: set correct h_errno upon failure previously gethostbyname_r(ipv6.google.com);herror("ERROR:") gave Answer name = |ipv6.google.com| Answer type = |5| herrno=1 h_errno=0 ERROR:: Error 0 herrno=1 h_errno=1 ERROR:: Unknown host Signed-off-by: Bernhard Reutner-Fischer --- libc/inet/resolv.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libc/inet') diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 21e84e52c..38a03bb9e 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -2170,6 +2170,7 @@ int gethostbyname_r(const char *name, } *h_errnop = HOST_NOT_FOUND; + __set_h_errno(HOST_NOT_FOUND); i = TRY_AGAIN; free_and_ret: -- cgit v1.2.3