From 6c5f254a5b88067532ea418fb6a8614081aa2114 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 30 Sep 2017 06:27:37 -0600 Subject: [PATCH] psock_send() no longer sets errno, so send() must now set it. --- net/socket/send.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; }