Author: tridge
Date: 2007-10-17 12:00:30 +0000 (Wed, 17 Oct 2007)
New Revision: 25676

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25676

Log:

fixed a valgrind error in the epoll event backend. The linked list
could get mucked up.

Modified:
   branches/SAMBA_4_0/source/lib/events/events_epoll.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/events/events_epoll.c
===================================================================
--- branches/SAMBA_4_0/source/lib/events/events_epoll.c 2007-10-17 09:50:39 UTC 
(rev 25675)
+++ branches/SAMBA_4_0/source/lib/events/events_epoll.c 2007-10-17 12:00:30 UTC 
(rev 25676)
@@ -163,8 +163,6 @@
 {
        struct epoll_event event;
 
-       DLIST_REMOVE(epoll_ev->fd_events, fde);
-               
        if (epoll_ev->epoll_fd == -1) return;
 
        fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_REPORT_ERROR;
@@ -232,7 +230,6 @@
 
        /* there's no epoll_event attached to the fde */
        if (want_read || (want_write && !got_error)) {
-               DLIST_ADD(epoll_ev->fd_events, fde);
                epoll_add_event(epoll_ev, fde);
                return;
        }
@@ -353,6 +350,8 @@
        epoll_ev->num_fd_events--;
        epoll_ev->destruction_count++;
 
+       DLIST_REMOVE(epoll_ev->fd_events, fde);
+               
        epoll_del_event(epoll_ev, fde);
 
        if (fde->flags & EVENT_FD_AUTOCLOSE) {

Reply via email to