summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-26 14:35:31 +0000
committerJeremy Allison <jra@samba.org>2014-03-31 22:52:13 +0200
commit328afb8d3e90f5d516dbe3a21ee80c2bd336a66d (patch)
tree0432ca83bb516b955a2cf117b8eaf2f45e83193c /source3/lib
parent994d75574b695bd335aa3bb1c9c9334c5a6b4b19 (diff)
downloadsamba-328afb8d3e90f5d516dbe3a21ee80c2bd336a66d.tar.gz
samba-328afb8d3e90f5d516dbe3a21ee80c2bd336a66d.tar.xz
samba-328afb8d3e90f5d516dbe3a21ee80c2bd336a66d.zip
mutex: Avoid passing lp_ctx to tdb_wrap_open in grab_named_mutex
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
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",