diff options
Diffstat (limited to 'lib/tdb/common/open.c')
-rw-r--r-- | lib/tdb/common/open.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index 16a76a347f..3b53fa7e3e 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -232,6 +232,14 @@ static bool tdb_mutex_open_ok(struct tdb_context *tdb, { int locked; + if (tdb->flags & TDB_NOLOCK) { + /* + * We don't look at locks, so it does not matter to have a + * compatible mutex implementation. Allow the open. + */ + return true; + } + locked = tdb_nest_lock(tdb, ACTIVE_LOCK, F_WRLCK, TDB_LOCK_NOWAIT|TDB_LOCK_PROBE); @@ -261,14 +269,6 @@ static bool tdb_mutex_open_ok(struct tdb_context *tdb, return false; } - if (tdb->flags & TDB_NOLOCK) { - /* - * We don't look at locks, so it does not matter to have a - * compatible mutex implementation. Allow the open. - */ - return true; - } - check_local_settings: if (!(tdb->flags & TDB_MUTEX_LOCKING)) { @@ -399,7 +399,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td tdb->read_only = 1; /* read only databases don't do locking or clear if first */ tdb->flags |= TDB_NOLOCK; - tdb->flags &= ~TDB_CLEAR_IF_FIRST; + tdb->flags &= ~(TDB_CLEAR_IF_FIRST|TDB_MUTEX_LOCKING); } if ((tdb->flags & TDB_ALLOW_NESTING) && |