net/tcp: syscall send() should not return ETIMEDOUT
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
969a06331f
commit
76c64b7d30
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user