From 7f7c2d721d1e336a86b29fecc81f5c0e28d105dc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 31 Mar 2012 13:34:42 +0200 Subject: s3-aio-fork: Fix aio_suspend event hierarchy We end up here multiple times. There's no real point putting the events into the child struct, at the end of this routine we need to free them anyway. --- source3/modules/vfs_aio_fork.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c index 16a1301c5e..30d4b93ee7 100644 --- a/source3/modules/vfs_aio_fork.c +++ b/source3/modules/vfs_aio_fork.c @@ -827,6 +827,8 @@ static int aio_fork_suspend(struct vfs_handle_struct *handle, */ for (child = children->children; child != NULL; child = child->next) { + struct tevent_fd *event; + if (child->aiocb == NULL) { continue; } @@ -841,16 +843,12 @@ static int aio_fork_suspend(struct vfs_handle_struct *handle, continue; } - /* We're never using this event on the - * main event context again... */ - TALLOC_FREE(child->sock_event); - - child->sock_event = event_add_fd(ev, - child, - child->sockfd, - EVENT_FD_READ, - handle_aio_completion, - child); + event = event_add_fd(ev, + frame, + child->sockfd, + EVENT_FD_READ, + handle_aio_completion, + child); while (1) { if (tevent_loop_once(ev) == -1) { -- cgit