getnameinfo: Rename a variable to avoid shadowing a global

This commit is contained in:
YAMAMOTO Takashi
2020-04-02 14:36:57 +09:00
committed by Xiang Xiao
parent 4311e5e724
commit 804c719319
+3 -3
View File
@@ -98,10 +98,10 @@ int getnameinfo(FAR const struct sockaddr *addr, socklen_t addrlen,
{ {
struct hostent hostent; struct hostent hostent;
FAR struct hostent *res; FAR struct hostent *res;
int h_errno; int error;
ret = gethostbyaddr_r(saddr, saddr_len, addr->sa_family, &hostent, ret = gethostbyaddr_r(saddr, saddr_len, addr->sa_family, &hostent,
host, hostlen, &res, &h_errno); host, hostlen, &res, &error);
if (ret == OK) if (ret == OK)
{ {
@@ -119,7 +119,7 @@ int getnameinfo(FAR const struct sockaddr *addr, socklen_t addrlen,
} }
else else
{ {
switch (h_errno) switch (error)
{ {
case HOST_NOT_FOUND: case HOST_NOT_FOUND:
{ {