lib: Use ctdbd_init_connection in messaging_ctdbd_init
authorVolker Lendecke <vl@samba.org>
Tue, 5 Apr 2016 08:11:44 +0000 (10:11 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Apr 2016 16:29:20 +0000 (18:29 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/messages_ctdbd.c

index 48563a832cd28c81365c8f3900bccd3cbe164648..a61c773957777045ecb1f1f1f2c230c6727b556d 100644 (file)
@@ -178,12 +178,20 @@ int messaging_ctdbd_init(struct messaging_context *msg_ctx,
                return ENOMEM;
        }
 
-       ret = ctdbd_messaging_connection(ctx, lp_ctdbd_socket(),
-                                        lp_ctdb_timeout(), &ctx->conn);
+       ret = ctdbd_init_connection(ctx, lp_ctdbd_socket(),
+                                   lp_ctdb_timeout(), &ctx->conn);
 
        if (ret != 0) {
-               DEBUG(10, ("ctdbd_messaging_connection failed: %s\n",
-                          strerror(ret)));
+               DBG_DEBUG("ctdbd_init_connection failed: %s\n",
+                         strerror(ret));
+               TALLOC_FREE(result);
+               return ret;
+       }
+
+       ret = register_with_ctdbd(ctx->conn, MSG_SRVID_SAMBA, NULL, NULL);
+       if (ret != 0) {
+               DBG_DEBUG("Could not register MSG_SRVID_SAMBA: %s\n",
+                         strerror(ret));
                TALLOC_FREE(result);
                return ret;
        }