summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-02-15 13:53:07 +0100
committerVolker Lendecke <vl@samba.org>2012-04-17 10:21:01 +0200
commit41712599e0f33096ccc81e7cd520e66dcf91a424 (patch)
treea25c5e936110a07df7618147ec64deebb4510f23
parent48a485b6396ba020df1c47cbecd6c9fe442ac8a5 (diff)
downloadsamba-41712599e0f33096ccc81e7cd520e66dcf91a424.tar.gz
samba-41712599e0f33096ccc81e7cd520e66dcf91a424.tar.bz2
samba-41712599e0f33096ccc81e7cd520e66dcf91a424.zip
s3: Add messaging_tdb_event()
This is a void* that represents a signal handler attached to some custom tevent_context. This is necessary to make the tdb based messaging infrastructure trigger its business when we are sitting in tevent_loop_once for an event context that is not the main one in the messaging context.
-rw-r--r--source3/include/messages.h3
-rw-r--r--source3/lib/messages_local.c10
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 2161a77d28..4b45901afd 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -98,6 +98,9 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
bool messaging_tdb_parent_init(TALLOC_CTX *mem_ctx);
+void *messaging_tdb_event(TALLOC_CTX *mem_ctx, struct messaging_context *msg,
+ struct tevent_context *ev);
+
NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
TALLOC_CTX *mem_ctx,
struct messaging_backend **presult);
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index b398870e1f..e20024ae59 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -77,6 +77,16 @@ static void messaging_tdb_signal_handler(struct tevent_context *ev_ctx,
message_dispatch(ctx->msg_ctx);
}
+void *messaging_tdb_event(TALLOC_CTX *mem_ctx, struct messaging_context *msg,
+ struct tevent_context *ev)
+{
+ struct messaging_tdb_context *msg_tdb = talloc_get_type_abort(
+ msg->local->private_data, struct messaging_tdb_context);
+
+ return tevent_add_signal(ev, mem_ctx, SIGUSR1, 0,
+ messaging_tdb_signal_handler, msg_tdb);
+}
+
/****************************************************************************
Initialise the messaging functions.
****************************************************************************/