local_recvmsg: do not print error message when errno is EAGAIN

Some programs use EAGAIN to determine whether all data has been read,
so cancel the error print when the error code is EAGAIN.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-05-16 19:48:02 +08:00 committed by Xiang Xiao
parent 8f297f79d8
commit 5b35c4e5b0

View File

@ -108,7 +108,15 @@ static int psock_fifo_read(FAR struct socket *psock, FAR void *buf,
}
else
{
nerr("ERROR: Failed to read packet: %d\n", ret);
if (ret == -EAGAIN)
{
nwarn("WARNING: Failed to read packet: %d\n", ret);
}
else
{
nerr("ERROR: Failed to read packet: %d\n", ret);
}
return ret;
}
}