inet_bind: errno alignment to Linux

cunittest error case: addr length is short.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2022-10-19 11:43:14 +08:00 committed by Xiang Xiao
parent d6b441f141
commit 6b955b0ef0

View File

@ -407,7 +407,7 @@ static int inet_bind(FAR struct socket *psock,
if (addrlen < minlen)
{
nerr("ERROR: Invalid address length: %d < %d\n", addrlen, minlen);
return -EBADF;
return -EINVAL;
}
/* Perform the binding depending on the protocol type */