mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix error cases in gethostbyaddr_r
EAI_MEMORY is not possible (but would not provide errno if it were) and EAI_FAIL does not provide errno. treat the latter as EBADMSG to match how it's handled in gethostbyname2_r (it indicates erroneous or failure response from the nameserver).
This commit is contained in:
parent
f9827fc7da
commit
dc9285ad1d
1 changed files with 3 additions and 2 deletions
|
@ -54,9 +54,10 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af,
|
||||||
case EAI_OVERFLOW:
|
case EAI_OVERFLOW:
|
||||||
return ERANGE;
|
return ERANGE;
|
||||||
default:
|
default:
|
||||||
case EAI_MEMORY:
|
|
||||||
case EAI_SYSTEM:
|
|
||||||
case EAI_FAIL:
|
case EAI_FAIL:
|
||||||
|
*err = NO_RECOVERY;
|
||||||
|
return EBADMSG;
|
||||||
|
case EAI_SYSTEM:
|
||||||
*err = NO_RECOVERY;
|
*err = NO_RECOVERY;
|
||||||
return errno;
|
return errno;
|
||||||
case 0:
|
case 0:
|
||||||
|
|
Loading…
Add table
Reference in a new issue