From b4a0864f64e4e6b5997012bb33e0e5e0fa760b03 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 22 Apr 2015 11:57:24 +0200 Subject: [PATCH] s3:smbd: add wrapper around reinit_after_fork 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 Reviewed-by: Jeremy Allison --- source3/include/proto.h | 3 +++ source3/smbd/server_exit.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/source3/include/proto.h b/source3/include/proto.h index 4acad41a939..30fd4fa3f12 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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, diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index 69d0fdd6bbb..700f595a488 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -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); +} -- 2.11.4.GIT