mirror of
https://github.com/irssi/irssi.git
synced 2025-04-25 12:31:09 -05:00
Fix using HOST_NOT_FOUND instead of EAI_NONAME.
HOST_NOT_FOUND is a gethostbyname(3) error condition rather than a getaddrinfo(3) error condition and cannot be passed to net_gethosterror as documented as it calls gai_strerror(3). EAI_NONAME is the appropriate similar error condition as standardized by POSIX for getaddrinfo(3).
This commit is contained in:
parent
5a9a9ababa
commit
f24d859c80
@ -430,7 +430,7 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count_v4 == 0 && count_v6 == 0)
|
if (count_v4 == 0 && count_v6 == 0)
|
||||||
return HOST_NOT_FOUND; /* shouldn't happen? */
|
return EAI_NONAME; /* shouldn't happen? */
|
||||||
|
|
||||||
/* if there are multiple addresses, return random one */
|
/* if there are multiple addresses, return random one */
|
||||||
use_v4 = count_v4 <= 1 ? 0 : rand() % count_v4;
|
use_v4 = count_v4 <= 1 ? 0 : rand() % count_v4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user