summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-05-03 17:29:35 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-05-03 17:29:35 +0200
commit408763f32676fa60e74cb202486be4b17a43974e (patch)
tree8608b4814dd829255afc842fb6741407f112fc08 /libc
parent05238889b2851aafda667b4d5e3b7e627ea2bed6 (diff)
getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r
Also, freeaddrinfo(NULL) is ok, no need to check parameted for NULL before calling it. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/getaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index e619effa1..1a77c5199 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -649,7 +649,7 @@ gaih_inet(const char *name, const struct gaih_service *service,
at2->family,
&th, tmpbuf, tmpbuflen,
&h, &herrno);
- } while (rc == errno && herrno == NETDB_INTERNAL);
+ } while (rc == ERANGE && herrno == NETDB_INTERNAL);
if (rc != 0 && herrno == NETDB_INTERNAL) {
__set_h_errno(herrno);
@@ -855,7 +855,7 @@ getaddrinfo(const char *name, const char *service,
last_i = i;
if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC))
continue;
- if (p)
+ /*if (p) - freeaddrinfo works ok on NULL too */
freeaddrinfo(p);
return -(i & GAIH_EAI);
}