merge from peter
[vlendec/samba-autobuild/.git] / ctdb / common / ctdb_daemon.c
index efb3f5431ec45d63ac60d87a76e8c4cccdfc135e..053c5af6dd14185d9165572af96ea85f64303e11 100644 (file)
@@ -44,6 +44,24 @@ static void daemon_incoming_packet(void *, uint8_t *, uint32_t );
 
 static void ctdb_main_loop(struct ctdb_context *ctdb)
 {
+       int ret = -1;
+
+       if (strcmp(ctdb->transport, "tcp") == 0) {
+               int ctdb_tcp_init(struct ctdb_context *);
+               ret = ctdb_tcp_init(ctdb);
+       }
+#ifdef USE_INFINBAND
+       if (strcmp(ctdb->transport, "ib") == 0) {
+               int ctdb_ibw_init(struct ctdb_context *);
+               ret = ctdb_ibw_init(ctdb);
+       }
+#endif
+       if (ret != 0) {
+               DEBUG(0,("Failed to initialise transport '%s'\n", ctdb->transport));
+               return;
+       }
+
+       /* start the transport running */
        ctdb->methods->start(ctdb);
 
        /* go into a wait loop to allow other nodes to complete */