diff --git a/net/socket/send.c b/net/socket/send.c index 6a78d6565a..fd4599fb3c 100644 --- a/net/socket/send.c +++ b/net/socket/send.c @@ -224,6 +224,12 @@ ssize_t send(int sockfd, FAR const void *buf, size_t len, int flags) /* And let psock_send do all of the work */ ret = psock_send(psock, buf, len, flags); + if (ret < 0) + { + set_errno((int)-ret); + ret = ERROR; + } + leave_cancellation_point(); return ret; }