X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb1_lock.c;h=1b7ab7c7dc6776b0186c0ab56facd464cacc2c1f;hp=65fa1c123c5086b208448ee0dcb8487f1073d965;hb=4dc29a338fadeac805b369b4b0851c02f1b152c7;hpb=3e46dde21261966941469a6c75e1b45cd2d26324 diff --git a/ccan/tdb2/tdb1_lock.c b/ccan/tdb2/tdb1_lock.c index 65fa1c12..1b7ab7c7 100644 --- a/ccan/tdb2/tdb1_lock.c +++ b/ccan/tdb2/tdb1_lock.c @@ -329,8 +329,8 @@ int tdb1_allrecord_lock(struct tdb1_context *tdb, int ltype, /* unlock entire db */ int tdb1_allrecord_unlock(struct tdb1_context *tdb, int ltype) { - /* There are no locks on read-only dbs */ - if (tdb->read_only || tdb->traverse_read) { + /* Don't try this during r/o traversal! */ + if (tdb->traverse_read) { tdb->last_error = TDB_ERR_LOCK; return -1; }