net/tcp: syscall send() should not return ETIMEDOUT
@@ -1232,6 +1232,11 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
tcp_send_gettimeout(start, timeout));
if (ret < 0)
{
+ if (ret == -ETIMEDOUT)
+ {
+ ret = -EAGAIN;
+ }
+
goto errout_with_lock;
}
}
@@ -1285,14 +1290,10 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf,
nerr("ERROR: Failed to allocate write buffer\n");
- if (nonblock)
+ if (nonblock || timeout != UINT_MAX)
{
ret = -EAGAIN;
}
- else if (timeout != UINT_MAX)
- {
- ret = -ETIMEDOUT;
- }
else
{
ret = -ENOMEM;
