X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=ustream-fd.c;h=0cd2eb3d7915c1e18e8e7d683afbc8aa52006dca;hp=6bb39e934e5dfd960cef528f0dcf2bef998c21d2;hb=300a809a7a6b30595962308c4215ead6ec361053;hpb=dc69ce4799deb53797266d55311871b9c0062066 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)