ustream-fd: fix read error handling

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2013-01-03 15:46:21 +01:00
parent e7825661a2
commit 6c28da1ae2

View file

@ -58,17 +58,19 @@ static void ustream_fd_read_pending(struct ustream_fd *sf, bool *more)
break;
len = read(sf->fd.fd, buf, buflen);
if (!len) {
sf->fd.eof = true;
return;
}
if (len < 0) {
if (errno == EINTR)
continue;
if (errno == EAGAIN)
return;
len = 0;
}
if (!len) {
sf->fd.eof = true;
return;
}
ustream_fill_read(s, len);