Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-30 20:48:55 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-01-30 20:48:55 +0400
commitf24b6294c2d070e03ce663a60cdc50c9e5ab50e8 (patch)
tree81e6dfcca97304c2b7d8b26d116156e027eff95f /ustream-fd.c
parente72b65c89936aafe16c28255ce326aac77f876a7 (diff)
ustream-fd: only use read() == 0 as eof indication, and issue a state change notification when that happens
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'ustream-fd.c')
-rw-r--r--ustream-fd.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/ustream-fd.c b/ustream-fd.c
index a252708..e39da98 100644
--- a/ustream-fd.c
+++ b/ustream-fd.c
@@ -72,6 +72,8 @@ static void ustream_fd_read_pending(struct ustream_fd *sf, bool *more)
if (!len) {
sf->fd.eof = true;
+ ustream_state_change(s);
+ ustream_fd_set_uloop(s, false);
return;
}
@@ -115,7 +117,6 @@ static int ustream_fd_write(struct ustream *s, const char *buf, int buflen, bool
static bool __ustream_fd_poll(struct ustream_fd *sf, unsigned int events)
{
struct ustream *s = &sf->stream;
- struct uloop_fd *fd = &sf->fd;
bool more = false;
if (events & ULOOP_READ)
@@ -126,12 +127,6 @@ static bool __ustream_fd_poll(struct ustream_fd *sf, unsigned int events)
ustream_fd_set_uloop(s, false);
}
- if (!s->eof && fd->eof) {
- s->eof = true;
- ustream_fd_set_uloop(s, false);
- ustream_state_change(s);
- }
-
return more;
}