projects
/
oweals
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e782566
)
ustream-fd: fix read error handling
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 3 Jan 2013 14:46:21 +0000
(15:46 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 3 Jan 2013 15:32:40 +0000
(16:32 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd.c
patch
|
blob
|
history
diff --git
a/ustream-fd.c
b/ustream-fd.c
index 93fd501903701e50f82edafa111c730e70001dd9..397ce5dbfd8c488aff663bbbf5a97847d23b2209 100644
(file)
--- a/
ustream-fd.c
+++ b/
ustream-fd.c
@@
-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);