r23577: Fix winbindd (sorry). Ensure I set the new child_pid
authorJeremy Allison <jra@samba.org>
Thu, 21 Jun 2007 22:10:41 +0000 (22:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:31 +0000 (12:23 -0500)
variable at the correct point just before the write
call is scheduled.
Jeremy.

source/nsswitch/winbindd_dual.c

index 4363bf0f935168e7bb621c827a705cc0617d1d84..255577c58cfc62023317ef0cead6886b1776b1af 100644 (file)
@@ -131,7 +131,6 @@ void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
        state->response = response;
        state->continuation = continuation;
        state->private_data = private_data;
        state->response = response;
        state->continuation = continuation;
        state->private_data = private_data;
-       state->child_pid = child->pid;
 
        DLIST_ADD_END(child->requests, state, struct winbindd_async_request *);
 
 
        DLIST_ADD_END(child->requests, state, struct winbindd_async_request *);
 
@@ -306,6 +305,9 @@ static void schedule_async_request(struct winbindd_child *child)
                return;
        }
 
                return;
        }
 
+       /* Now we know who we're sending to - remember the pid. */
+       request->child_pid = child->pid;
+
        setup_async_write(&child->event, request->request,
                          sizeof(*request->request),
                          async_main_request_sent, request);
        setup_async_write(&child->event, request->request,
                          sizeof(*request->request),
                          async_main_request_sent, request);