X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Flock.c;h=bd896a35e0144d5b2db619598cabd0bf4ae62690;hb=acb26c9c3ee054c8b2141db25c9bd7be064e425c;hp=173130b2d57eefaf315b2a00ad55e4a5e90e1536;hpb=fbad02b680b6cbc33ae305ae1cbcdead4eedc7b1;p=ccan diff --git a/ccan/tdb2/lock.c b/ccan/tdb2/lock.c index 173130b2..bd896a35 100644 --- a/ccan/tdb2/lock.c +++ b/ccan/tdb2/lock.c @@ -862,7 +862,12 @@ void tdb_lock_cleanup(struct tdb_context *tdb) while (tdb->file->allrecord_lock.count && tdb->file->allrecord_lock.owner == tdb) { - tdb_allrecord_unlock(tdb, tdb->file->allrecord_lock.ltype); + if (tdb->flags & TDB_VERSION1) + tdb1_allrecord_unlock(tdb, + tdb->file->allrecord_lock.ltype); + else + tdb_allrecord_unlock(tdb, + tdb->file->allrecord_lock.ltype); } for (i=0; ifile->num_lockrecs; i++) {