remove the old ctdb_attach() function and move all callers over to the new ctdb_attac...
[sahlberg/ctdb.git] / tests / src / ctdb_persistent.c
index 4ae782b35677ad665b38c1693740fbd60b5012fd..87a629e5a4355a34d27d9b82e5057741dcc10cfd 100644 (file)
@@ -193,7 +193,7 @@ int main(int argc, const char *argv[])
                { "unsafe-writes", 'u', POPT_ARG_NONE, &unsafe_writes, 0, "do not use tdb transactions when writing", NULL },
                POPT_TABLEEND
        };
-       int opt;
+       int ret, opt;
        const char **extra_argv;
        int extra_argc = 0;
        poptContext pc;
@@ -229,12 +229,12 @@ int main(int argc, const char *argv[])
 
        /* attach to a specific database */
        if (unsafe_writes == 1) {
-               ctdb_db = ctdb_attach(ctdb, "persistent.tdb", true, TDB_NOSYNC);
+         ret = ctdb_attachdb(ctdb, "persistent.tdb", true, TDB_NOSYNC, &ctdb_db);
        } else {
-               ctdb_db = ctdb_attach(ctdb, "persistent.tdb", true, 0);
+         ret = ctdb_attachdb(ctdb, "persistent.tdb", true, 0, &ctdb_db);
        }
 
-       if (!ctdb_db) {
+       if (ret) {
                printf("ctdb_attach failed - %s\n", ctdb_errstr(ctdb));
                exit(1);
        }