create a ctdb_attachdb_recv() function for libctdb.
[sahlberg/ctdb.git] / libctdb / tst.c
index 08d515eb3aa6caddcebff203c156f39cc1169742..dc030fe683e7a6015a976a016dc7a8ac89bf40f1 100644 (file)
@@ -32,6 +32,7 @@ void adb_cb(int32_t status, struct ctdb_db_context *ctdb_db, void *private_data)
 int main(int argc, char *argv[])
 {
        struct ctdb_context *ctdb_context;
+       struct ctdb_db_context *ctdb_db_context;
        ctdb_handle *handle;
        struct pollfd pfd;
        int ret;
@@ -59,21 +60,21 @@ int main(int argc, char *argv[])
                exit(10);
        }
 
-       handle = ctdb_getpnn_send(ctdb_context, CTDB_CURRENT_NODE, pnn_cb, NULL);
+       handle = ctdb_attachdb_send(ctdb_context, CTDB_CURRENT_NODE, "test_test.tdb", 0, 0, adb_cb, NULL);
        if (handle == NULL) {
-               printf("Failed to send get_pnn control\n");
+               printf("Failed to send attachdb control\n");
                exit(10);
        }
 
-       handle = ctdb_getrecmaster_send(ctdb_context, CTDB_CURRENT_NODE, rm_cb, NULL);
+       handle = ctdb_getpnn_send(ctdb_context, CTDB_CURRENT_NODE, pnn_cb, NULL);
        if (handle == NULL) {
-               printf("Failed to send get_recmaster control\n");
+               printf("Failed to send get_pnn control\n");
                exit(10);
        }
 
-       handle = ctdb_attachdb_send(ctdb_context, CTDB_CURRENT_NODE, "test_test.tdb", 0,0, adb_cb, NULL);
+       handle = ctdb_getrecmaster_send(ctdb_context, CTDB_CURRENT_NODE, rm_cb, NULL);
        if (handle == NULL) {
-               printf("Failed to send attachdb control\n");
+               printf("Failed to send get_recmaster control\n");
                exit(10);
        }