s3: Remove a bunch of calls to procid_self()
[ira/wip.git] / source3 / lib / messages_ctdbd.c
index 96a33abf50957f391c9072058dd13ee020fcab98..b7db2a76f094bbd85646bbf959adc3856c4c1f54 100644 (file)
@@ -2,27 +2,45 @@
    Unix SMB/CIFS implementation.
    Samba internal messaging functions
    Copyright (C) 2007 by Volker Lendecke
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "messages.h"
+#include "util_tdb.h"
 
 #ifdef CLUSTER_SUPPORT
 
-#include "librpc/gen_ndr/messaging.h"
+/*
+ * It is not possible to include ctdb.h and tdb_compat.h (included via
+ * some other include above) without warnings. This fixes those
+ * warnings.
+ */
+
+#ifdef typesafe_cb
+#undef typesafe_cb
+#endif
+
+#ifdef typesafe_cb_preargs
+#undef typesafe_cb_preargs
+#endif
+
+#ifdef typesafe_cb_postargs
+#undef typesafe_cb_postargs
+#endif
+
 #include "ctdb.h"
 #include "ctdb_private.h"
 #include "ctdbd_conn.h"
@@ -51,7 +69,7 @@ struct ctdbd_connection *messaging_ctdbd_connection(void)
                        DEBUG(0,("event_context_init failed\n"));
                }
 
-               msg = messaging_init(NULL, procid_self(), ev);
+               msg = messaging_init(NULL, ev);
                if (!msg) {
                        DEBUG(0,("messaging_init failed\n"));
                        return NULL;
@@ -105,12 +123,12 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
        struct messaging_ctdbd_context *ctx;
        NTSTATUS status;
 
-       if (!(result = TALLOC_P(mem_ctx, struct messaging_backend))) {
+       if (!(result = talloc(mem_ctx, struct messaging_backend))) {
                DEBUG(0, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!(ctx = TALLOC_P(result, struct messaging_ctdbd_context))) {
+       if (!(ctx = talloc(result, struct messaging_ctdbd_context))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NT_STATUS_NO_MEMORY;