X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftransaction.c;h=b13223bc2e18c7f82b6fdf4615adc69ca14bbffb;hp=9205828a8a16138d754e0013b68d9b91396b1894;hb=de868b8eee34e39b4465dd9def9141b97926e847;hpb=4601063b15ad7a1896135bf91bbcb7cabfbc9000;ds=sidebyside diff --git a/ccan/tdb2/transaction.c b/ccan/tdb2/transaction.c index 9205828a..b13223bc 100644 --- a/ccan/tdb2/transaction.c +++ b/ccan/tdb2/transaction.c @@ -509,7 +509,7 @@ static void _tdb_transaction_cancel(struct tdb_context *tdb) 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); } @@ -1005,7 +1005,7 @@ static enum TDB_ERROR _tdb_transaction_prepare_commit(struct tdb_context *tdb) /* 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; }