smbd: Move smbprofile_cleanup() to the cleanupd
authorVolker Lendecke <vl@samba.org>
Fri, 6 Nov 2015 14:21:59 +0000 (15:21 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 16 Nov 2015 13:51:33 +0000 (14:51 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/server.c
source3/smbd/smbd_cleanupd.c

index 46e655a6e4f45f83516039247c775c5ef716a5fe..4edca4b90e86135e7e0de32f1ec86e04486ca7dd 100644 (file)
@@ -579,8 +579,6 @@ static void remove_child_pid(struct smbd_parent_context *parent,
                           __func__, strerror(ret)));
        }
 
-       smbprofile_cleanup(pid, getpid());
-
        for (child = parent->children; child != NULL; child = child->next) {
                if (child->pid == pid) {
                        struct smbd_child_pid *tmp = child;
index f11a0a443d1d4e46123baffa9b011622abcfbb11..2f3d19fbf5ad83164c4c32b8ec11e200d7173aab 100644 (file)
@@ -21,6 +21,7 @@
 #include "smbd_cleanupd.h"
 #include "lib/util/tevent_ntstatus.h"
 #include "lib/util/debug.h"
+#include "smbprofile.h"
 
 struct smbd_cleanupd_state {
        pid_t parent_pid;
@@ -98,6 +99,8 @@ static void smbd_cleanupd_process_exited(struct messaging_context *msg,
 
        DBG_DEBUG("%d exited %sclean\n", (int)pid,
                  unclean_shutdown ? "un" : "");
+
+       smbprofile_cleanup(pid, state->parent_pid);
 }
 
 NTSTATUS smbd_cleanupd_recv(struct tevent_req *req)