]> git.llucax.com Git - software/libev.git/commitdiff
*** empty log message ***
authorroot <root>
Thu, 1 Nov 2007 09:21:51 +0000 (09:21 +0000)
committerroot <root>
Thu, 1 Nov 2007 09:21:51 +0000 (09:21 +0000)
ev.c

diff --git a/ev.c b/ev.c
index 9f35287c51097b94a498ad212fb0a5b4b2582373..9674c7c056c75b7192c3fe8608a54a8e5dc5e57a 100644 (file)
--- a/ev.c
+++ b/ev.c
@@ -170,6 +170,12 @@ static int pendingmax, pendingcnt;
 static void
 event (W w, int events)
 {
+  if (w->pending)
+    {
+      pendings [w->pending - 1].events |= events;
+      return;
+    }
+
   w->pending = ++pendingcnt;
   array_needsize (pendings, pendingmax, pendingcnt, );
   pendings [pendingcnt - 1].w      = w;
@@ -257,8 +263,8 @@ fd_recheck (void)
       if (fcntl (fd, F_GETFD) == -1 && errno == EBADF)
         while (anfds [fd].head)
           {
-            event ((W)anfds [fd].head, EV_ERROR | EV_READ | EV_WRITE | EV_TIMEOUT);
             ev_io_stop (anfds [fd].head);
+            event ((W)anfds [fd].head, EV_ERROR | EV_READ | EV_WRITE | EV_TIMEOUT);
           }
 }