From: Martin Mares Date: Fri, 19 Aug 2011 10:38:59 +0000 (+0200) Subject: Main: Complete the fix in HEAD^^ X-Git-Tag: v5.0~110 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=e44352c09646e4697032946259ea8aaa18ceb252;p=libucw.git Main: Complete the fix in HEAD^^ --- diff --git a/ucw/mainloop.c b/ucw/mainloop.c index b7ee5bf9..c7fe0125 100644 --- a/ucw/mainloop.c +++ b/ucw/mainloop.c @@ -856,14 +856,6 @@ main_loop(void) struct main_file *fi; while (fi = clist_head(&m->file_active_list)) { - if (fi->write_handler && (fi->events & (POLLOUT | POLLHUP | POLLERR))) - { - fi->events &= ~(POLLOUT | POLLHUP | POLLERR); - do - DBG("MAIN: Write event on fd %d", fi->fd); - while (fi->write_handler && fi->write_handler(fi)); - continue; - } if (fi->read_handler && (fi->events & (POLLIN | POLLHUP))) { fi->events &= ~(POLLIN | POLLHUP); @@ -872,6 +864,14 @@ main_loop(void) while (fi->read_handler && fi->read_handler(fi)); continue; } + if (fi->write_handler && (fi->events & (POLLOUT | POLLHUP | POLLERR))) + { + fi->events &= ~(POLLOUT | POLLHUP | POLLERR); + do + DBG("MAIN: Write event on fd %d", fi->fd); + while (fi->write_handler && fi->write_handler(fi)); + continue; + } clist_remove(&fi->n); clist_add_tail(&m->file_list, &fi->n); }