mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
socket: separation error code EBADF and ENOTSOCK
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
2c95c04f4e
commit
f00c11aec4
@@ -147,11 +147,15 @@ ssize_t sendmsg(int sockfd, FAR struct msghdr *msg, int flags)
|
||||
|
||||
/* Get the underlying socket structure */
|
||||
|
||||
psock = sockfd_socket(sockfd);
|
||||
ret = sockfd_socket(sockfd, &psock);
|
||||
|
||||
/* Then let psock_sendmsg() do all of the work */
|
||||
/* Let psock_sendmsg() do all of the work */
|
||||
|
||||
if (ret == OK)
|
||||
{
|
||||
ret = psock_sendmsg(psock, msg, flags);
|
||||
}
|
||||
|
||||
ret = psock_sendmsg(psock, msg, flags);
|
||||
if (ret < 0)
|
||||
{
|
||||
_SO_SETERRNO(psock, -ret);
|
||||
|
||||
Reference in New Issue
Block a user