sockets: Fix missing err_to_errno conversion for ERR_VAL in lwip_recvmsg

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2018-11-08 22:43:51 +08:00
parent 7869d7c5f7
commit 7bcf0d3334

View File

@ -1305,7 +1305,7 @@ lwip_recvmsg(int s, struct msghdr *message, int flags)
if ((message->msg_iov[i].iov_base == NULL) || ((ssize_t)message->msg_iov[i].iov_len <= 0) || if ((message->msg_iov[i].iov_base == NULL) || ((ssize_t)message->msg_iov[i].iov_len <= 0) ||
((size_t)(ssize_t)message->msg_iov[i].iov_len != message->msg_iov[i].iov_len) || ((size_t)(ssize_t)message->msg_iov[i].iov_len != message->msg_iov[i].iov_len) ||
((ssize_t)(buflen + (ssize_t)message->msg_iov[i].iov_len) <= 0)) { ((ssize_t)(buflen + (ssize_t)message->msg_iov[i].iov_len) <= 0)) {
sock_set_errno(sock, ERR_VAL); sock_set_errno(sock, err_to_errno(ERR_VAL));
done_socket(sock); done_socket(sock);
return -1; return -1;
} }