summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-10-17 12:00:30 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:09 +0100
commite95a5e25419cd64eb8a0266178f77dd05c082c6e (patch)
tree07c44ad42db6d15fb7ca957ac322dc1acb8f56d1 /source4/lib
parentc7a1a4abfa1beaa2d613b46f43c589f928cf287b (diff)
downloadsamba-e95a5e25419cd64eb8a0266178f77dd05c082c6e.tar.gz
samba-e95a5e25419cd64eb8a0266178f77dd05c082c6e.tar.bz2
samba-e95a5e25419cd64eb8a0266178f77dd05c082c6e.zip
r25676: fixed a valgrind error in the epoll event backend. The linked list
could get mucked up. (This used to be commit 67240f380b2828eb85463ab2d256ae601f57348f)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/events/events_epoll.c5
1 files changed, 2 insertions, 3 deletions
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) {