mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
getservbyport_r: fix wrong result if getnameinfo fails with EAI_OVERFLOW
EAI_OVERFLOW should be propagated as ERANGE to inform the caller about the need to expand the buffer.
This commit is contained in:
parent
595416b11d
commit
b1dfb734a4
1 changed files with 2 additions and 0 deletions
|
@ -46,6 +46,8 @@ int getservbyport_r(int port, const char *prots,
|
|||
case EAI_MEMORY:
|
||||
case EAI_SYSTEM:
|
||||
return ENOMEM;
|
||||
case EAI_OVERFLOW:
|
||||
return ERANGE;
|
||||
default:
|
||||
return ENOENT;
|
||||
case 0:
|
||||
|
|
Loading…
Add table
Reference in a new issue