s3:smbd: add wrapper around reinit_after_fork
authorRalph Boehme <slow@samba.org>
Wed, 22 Apr 2015 09:57:24 +0000 (11:57 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 22 Apr 2015 21:00:20 +0000 (23:00 +0200)
smbd_reinit_after_fork is a simple wrapper around reinit_after_fork that
should be used after forking from the main smbd.

At the moment the only additional step it performs is resetting
am_parent to NULL.

A subsequent commit will make use of this function.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/proto.h
source3/smbd/server_exit.c

index 4acad41a939c293b877f8b53a69f202c460af993..30fd4fa3f12dff509b553522298a756030c2ee02 100644 (file)
@@ -374,6 +374,9 @@ NTSTATUS init_before_fork(void);
 NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
                           struct tevent_context *ev_ctx,
                           bool parent_longlived);
+NTSTATUS smbd_reinit_after_fork(struct messaging_context *msg_ctx,
+                               struct tevent_context *ev_ctx,
+                               bool parent_longlived);
 void *malloc_(size_t size);
 void *Realloc(void *p, size_t size, bool free_old_on_error);
 void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
index 69d0fdd6bbbd6362b000a50a25d1f2c4b5140ff4..700f595a4880151d6897979a3537009a2be9115e 100644 (file)
@@ -268,3 +268,15 @@ void smbd_exit_server_cleanly(const char *const explanation)
 {
        exit_server_common(SERVER_EXIT_NORMAL, explanation);
 }
+
+/*
+ * reinit_after_fork() wrapper that should be called when forking from
+ * smbd.
+ */
+NTSTATUS smbd_reinit_after_fork(struct messaging_context *msg_ctx,
+                               struct tevent_context *ev_ctx,
+                               bool parent_longlived)
+{
+       am_parent = NULL;
+       return reinit_after_fork(msg_ctx, ev_ctx, parent_longlived);
+}