local_socket: remove error log when use nonblock mode
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
4e92e32d7b
commit
e489a308c8
@ -77,15 +77,23 @@ int local_fifo_read(FAR struct file *filep, FAR uint8_t *buf,
|
|||||||
{
|
{
|
||||||
nread = file_read(filep, buf, remaining);
|
nread = file_read(filep, buf, remaining);
|
||||||
if (nread < 0)
|
if (nread < 0)
|
||||||
{
|
|
||||||
if (nread != -EINTR)
|
|
||||||
{
|
{
|
||||||
ret = (int)nread;
|
ret = (int)nread;
|
||||||
|
|
||||||
|
if (nread == -EINTR)
|
||||||
|
{
|
||||||
|
ninfo("Ignoring signal\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (nread == -EAGAIN)
|
||||||
|
{
|
||||||
|
goto errout;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
nerr("ERROR: file_read() failed: %d\n", ret);
|
nerr("ERROR: file_read() failed: %d\n", ret);
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
ninfo("Ignoring signal\n");
|
|
||||||
}
|
}
|
||||||
else if (nread == 0)
|
else if (nread == 0)
|
||||||
{
|
{
|
||||||
|
@ -86,13 +86,20 @@ static int local_fifo_write(FAR struct file *filep, FAR const uint8_t *buf,
|
|||||||
ret = file_write(filep, buf + nwritten, len - nwritten);
|
ret = file_write(filep, buf + nwritten, len - nwritten);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
if (ret != -EINTR)
|
if (ret == -EINTR)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (ret == -EAGAIN)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
nerr("ERROR: file_write failed: %zd\n", ret);
|
nerr("ERROR: file_write failed: %zd\n", ret);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nwritten += ret;
|
nwritten += ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user