dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_ctdb
authorVolker Lendecke <vl@samba.org>
Wed, 26 Mar 2014 14:32:58 +0000 (14:32 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 31 Mar 2014 20:52:13 +0000 (22:52 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/dbwrap/dbwrap_ctdb.c

index b11334453426862bca75678bb1e548ee3c5a81eb..32d044628d13e092f2947b8e5ef7a8b0e42539e4 100644 (file)
@@ -1661,8 +1661,13 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 
        lp_ctx = loadparm_init_s3(db_path, loadparm_s3_helpers());
 
-       db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size, tdb_flags,
-                                     O_RDWR, 0, lp_ctx);
+       if (hash_size == 0) {
+               hash_size = lpcfg_tdb_hash_size(lp_ctx, db_path);
+       }
+
+       db_ctdb->wtdb = tdb_wrap_open_(db_ctdb, db_path, hash_size,
+                                      lpcfg_tdb_flags(lp_ctx, tdb_flags),
+                                      O_RDWR, 0);
        talloc_unlink(db_path, lp_ctx);
        if (db_ctdb->wtdb == NULL) {
                DEBUG(0, ("Could not open tdb %s: %s\n", db_path, strerror(errno)));