tdb_transaction_unlock(tdb, F_WRLCK);
if (tdb_has_open_lock(tdb))
- tdb_unlock_open(tdb);
+ tdb_unlock_open(tdb, F_WRLCK);
SAFE_FREE(tdb->transaction);
}
/* get the open lock - this prevents new users attaching to the database
during the commit */
- ecode = tdb_lock_open(tdb, TDB_LOCK_WAIT|TDB_LOCK_NOCHECK);
+ ecode = tdb_lock_open(tdb, F_WRLCK, TDB_LOCK_WAIT|TDB_LOCK_NOCHECK);
if (ecode != TDB_SUCCESS) {
return ecode;
}