X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Fhash.c;h=3db1ac2ebc7c85b9b50006138953ba38aafc7584;hp=9ebc1fe260e0e126c32a711c3deaa34c5d052bb6;hb=086a4e1915a8307c08320900df0099842a894135;hpb=b21004624683be5bf1d8f75e3b5be4e9618049ee;ds=sidebyside diff --git a/ccan/tdb2/hash.c b/ccan/tdb2/hash.c index 9ebc1fe2..3db1ac2e 100644 --- a/ccan/tdb2/hash.c +++ b/ccan/tdb2/hash.c @@ -857,7 +857,8 @@ static enum TDB_ERROR chainlock(struct tdb_context *tdb, const TDB_DATA *key, contention - it cannot guarantee how many records will be locked */ enum TDB_ERROR tdb_chainlock(struct tdb_context *tdb, TDB_DATA key) { - return chainlock(tdb, &key, F_WRLCK, TDB_LOCK_WAIT, "tdb_chainlock"); + return tdb->last_error = chainlock(tdb, &key, F_WRLCK, TDB_LOCK_WAIT, + "tdb_chainlock"); } enum TDB_ERROR tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key) @@ -872,5 +873,6 @@ enum TDB_ERROR tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key) lockstart = hlock_range(group, &locksize); tdb_trace_1rec(tdb, "tdb_chainunlock", key); - return tdb_unlock_hashes(tdb, lockstart, locksize, F_WRLCK); + return tdb->last_error = tdb_unlock_hashes(tdb, lockstart, locksize, + F_WRLCK); }