From 994d75574b695bd335aa3bb1c9c9334c5a6b4b19 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Mar 2014 14:32:58 +0000 Subject: [PATCH] dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_ctdb Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/lib/dbwrap/dbwrap_ctdb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index b1133445342..32d044628d1 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -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))); -- 2.11.4.GIT