From e44352c09646e4697032946259ea8aaa18ceb252 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 19 Aug 2011 12:38:59 +0200 Subject: [PATCH] Main: Complete the fix in HEAD^^ --- ucw/mainloop.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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); } -- 2.39.5