From 6b955b0ef0a620eebbf5ff7daf6644f6790d813f Mon Sep 17 00:00:00 2001 From: zhanghongyu Date: Wed, 19 Oct 2022 11:43:14 +0800 Subject: [PATCH] inet_bind: errno alignment to Linux cunittest error case: addr length is short. Signed-off-by: zhanghongyu --- net/inet/inet_sockif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/inet/inet_sockif.c b/net/inet/inet_sockif.c index 2c07941791..6ea41d8ce3 100644 --- a/net/inet/inet_sockif.c +++ b/net/inet/inet_sockif.c @@ -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 */