X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Fhash.c;fp=ccan%2Ftdb2%2Fhash.c;h=5b44678e14421aa878080cfbbda07b9f3327e527;hp=6340267c56832f1cc0698b8c17a57be07b7c7526;hb=3835bb95d716cb6448913792b0d8d539877d93e9;hpb=c02f63e60ca4c9778a1e635ffcd07d17fc8bf09d diff --git a/ccan/tdb2/hash.c b/ccan/tdb2/hash.c index 6340267c..5b44678e 100644 --- a/ccan/tdb2/hash.c +++ b/ccan/tdb2/hash.c @@ -448,8 +448,8 @@ static enum TDB_ERROR COLD add_to_chain(struct tdb_context *tdb, if (!next) { next = alloc(tdb, 0, sizeof(struct tdb_chain), 0, TDB_CHAIN_MAGIC, false); - if (next == TDB_OFF_ERR) - return tdb->ecode; + if (TDB_OFF_IS_ERR(next)) + return next; ecode = zero_out(tdb, next+sizeof(struct tdb_used_record), sizeof(struct tdb_chain)); @@ -521,8 +521,8 @@ static enum TDB_ERROR expand_group(struct tdb_context *tdb, struct hash_info *h) } subhash = alloc(tdb, 0, subsize, 0, magic, false); - if (subhash == TDB_OFF_ERR) { - return tdb->ecode; + if (TDB_OFF_IS_ERR(subhash)) { + return subhash; } ecode = zero_out(tdb, subhash + sizeof(struct tdb_used_record),