]> mj.ucw.cz Git - libucw.git/commitdiff
Main: Complete the fix in HEAD^^
authorMartin Mares <mj@ucw.cz>
Fri, 19 Aug 2011 10:38:59 +0000 (12:38 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 19 Aug 2011 10:38:59 +0000 (12:38 +0200)
ucw/mainloop.c

index b7ee5bf989c52baac52b3e988d567e20ffea415c..c7fe01250b365649fdca44bfd2acc9a904f0c041 100644 (file)
@@ -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);
        }