s3-messaging/ctdb: add messaging_ctdbd_reinit()
authorRalph Boehme <slow@samba.org>
Sat, 9 Jul 2016 12:30:35 +0000 (14:30 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 11 Jul 2016 18:05:06 +0000 (20:05 +0200)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/include/messages.h
source3/lib/ctdb_dummy.c
source3/lib/messages_ctdbd.c

index 8bbe0260441a75b8e434d21df703130e1fde90b6..2eaf146fbb2bd84a90a29ac4d066adce5dae0f08 100644 (file)
@@ -79,6 +79,9 @@ struct messaging_backend {
 int messaging_ctdbd_init(struct messaging_context *msg_ctx,
                         TALLOC_CTX *mem_ctx,
                         struct messaging_backend **presult);
+int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
+                          TALLOC_CTX *mem_ctx,
+                          struct messaging_backend *backend);
 struct ctdbd_connection *messaging_ctdbd_connection(void);
 
 bool message_send_all(struct messaging_context *msg_ctx,
index ec0bcc45bcb4b5b40ae7ea21d728d478858eb14f..8b617bab288d768670814c1ac88948f91e4c9635 100644 (file)
@@ -83,6 +83,13 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
        return ENOSYS;
 }
 
+int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
+                          TALLOC_CTX *mem_ctx,
+                          struct messaging_backend *backend)
+{
+       return ENOSYS;
+}
+
 struct ctdbd_connection *messaging_ctdbd_connection(void)
 {
        return NULL;
index cdf8fb7ca0f52900e45b2488944ed707577f670f..5964894323ec3163b87c7a7f62ba2ce57878284b 100644 (file)
@@ -268,3 +268,19 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
        *presult = result;
        return 0;
 }
+
+int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
+                          TALLOC_CTX *mem_ctx,
+                          struct messaging_backend *backend)
+{
+       struct messaging_ctdbd_context *ctx = talloc_get_type_abort(
+               backend->private_data, struct messaging_ctdbd_context);
+       int ret;
+
+       ret = messaging_ctdbd_init_internal(msg_ctx, mem_ctx, ctx, true);
+       if (ret != 0) {
+               return ret;
+       }
+
+       return 0;
+}