diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-30 20:26:40 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-30 20:26:40 +0400 |
commit | 300a809a7a6b30595962308c4215ead6ec361053 (patch) | |
tree | 08bbc49459476c45512bae01443f8ba027438afb /ustream-fd.c | |
parent | 84822fd6d529abc35bf8023403d547f8001bf5f3 (diff) |
ustream: fix polling for write buffer availability after buffering writes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'ustream-fd.c')
-rw-r--r-- | ustream-fd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ustream-fd.c b/ustream-fd.c index 6bb39e9..0cd2eb3 100644 --- a/ustream-fd.c +++ b/ustream-fd.c @@ -105,7 +105,7 @@ static bool __ustream_fd_poll(struct ustream_fd *sf, unsigned int events) ustream_fd_read_pending(sf, &more); if (events & ULOOP_WRITE) { - if (ustream_write_pending(s)) + if (!ustream_write_pending(s)) ustream_fd_set_uloop(s); } @@ -122,7 +122,7 @@ static bool ustream_fd_poll(struct ustream *s) { struct ustream_fd *sf = container_of(s, struct ustream_fd, stream); - return __ustream_fd_poll(sf, ULOOP_READ); + return __ustream_fd_poll(sf, ULOOP_READ | ULOOP_WRITE); } static void ustream_uloop_cb(struct uloop_fd *fd, unsigned int events) |