Skip to content

Commit

Permalink
socket-util: getaddrinfo return values for Windows.
Browse files Browse the repository at this point in the history
Couple of return values need changes.
* EAI_NODATA is the same as EAI_NONAME. So we prevent duplicate cases.
* Windows does not have a EAI_SYSTEM.

Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Feb 21, 2014
1 parent de8bd59 commit 99ad8ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/socket-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,15 @@ lookup_hostname(const char *host_name, struct in_addr *addr)
case EAI_MEMORY:
return ENOMEM;

#ifdef EAI_NODATA
#if defined (EAI_NODATA) && EAI_NODATA != EAI_NONAME
case EAI_NODATA:
return ENXIO;
#endif

#ifdef EAI_SYSTEM
case EAI_SYSTEM:
return sock_errno();
#endif

default:
return EPROTO;
Expand Down

0 comments on commit 99ad8ba

Please sign in to comment.