diff --git a/net/local/local_recvutils.c b/net/local/local_recvutils.c index cdead61309..ee67074d76 100644 --- a/net/local/local_recvutils.c +++ b/net/local/local_recvutils.c @@ -78,14 +78,22 @@ int local_fifo_read(FAR struct file *filep, FAR uint8_t *buf, nread = file_read(filep, buf, remaining); if (nread < 0) { - if (nread != -EINTR) + ret = (int)nread; + + if (nread == -EINTR) + { + ninfo("Ignoring signal\n"); + continue; + } + else if (nread == -EAGAIN) + { + goto errout; + } + else { - ret = (int)nread; nerr("ERROR: file_read() failed: %d\n", ret); goto errout; } - - ninfo("Ignoring signal\n"); } else if (nread == 0) { diff --git a/net/local/local_sendpacket.c b/net/local/local_sendpacket.c index a2840ece26..937c40a717 100644 --- a/net/local/local_sendpacket.c +++ b/net/local/local_sendpacket.c @@ -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); if (ret < 0) { - if (ret != -EINTR) + if (ret == -EINTR) + { + continue; + } + else if (ret == -EAGAIN) + { + break; + } + else { nerr("ERROR: file_write failed: %zd\n", ret); break; } - continue; } nwritten += ret;