summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/server_mutex.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/lib/server_mutex.c b/source3/lib/server_mutex.c
index c86047b439e..24a301bde97 100644
--- a/source3/lib/server_mutex.c
+++ b/source3/lib/server_mutex.c
@@ -48,6 +48,8 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
{
struct named_mutex *result;
struct loadparm_context *lp_ctx;
+ const char *fname;
+
result = talloc(mem_ctx, struct named_mutex);
if (result == NULL) {
DEBUG(0, ("talloc failed\n"));
@@ -68,11 +70,15 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name,
return NULL;
}
- result->tdb = tdb_wrap_open(result, lock_path("mutex.tdb"), 0,
- TDB_DEFAULT |
- TDB_CLEAR_IF_FIRST |
- TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0600, lp_ctx);
+ fname = lock_path("mutex.tdb");
+
+ result->tdb = tdb_wrap_open_(result, fname,
+ lpcfg_tdb_hash_size(lp_ctx, fname),
+ lpcfg_tdb_flags(lp_ctx,
+ TDB_DEFAULT |
+ TDB_CLEAR_IF_FIRST |
+ TDB_INCOMPATIBLE_HASH),
+ O_RDWR|O_CREAT, 0600);
talloc_unlink(result, lp_ctx);
if (result->tdb == NULL) {
DEBUG(1, ("Could not open mutex.tdb: %s\n",