From e95a5e25419cd64eb8a0266178f77dd05c082c6e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Oct 2007 12:00:30 +0200 Subject: r25676: fixed a valgrind error in the epoll event backend. The linked list could get mucked up. (This used to be commit 67240f380b2828eb85463ab2d256ae601f57348f) --- source4/lib/events/events_epoll.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/lib/events') diff --git a/source4/lib/events/events_epoll.c b/source4/lib/events/events_epoll.c index e2212e5333..109027eb1a 100644 --- a/source4/lib/events/events_epoll.c +++ b/source4/lib/events/events_epoll.c @@ -163,8 +163,6 @@ static void epoll_del_event(struct epoll_event_context *epoll_ev, struct fd_even { 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 @@ static void epoll_change_event(struct epoll_event_context *epoll_ev, struct fd_e /* 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 @@ static int epoll_event_fd_destructor(struct fd_event *fde) 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) { -- cgit