- if (next == TDB_OFF_ERR)
- return -1;
- if (zero_out(tdb, next+sizeof(struct tdb_used_record),
- sizeof(struct tdb_chain)))
- return -1;
- if (tdb_write_off(tdb, subhash
- + offsetof(struct tdb_chain, next),
- next) != 0)
- return -1;
+ if (TDB_OFF_IS_ERR(next))
+ return next;
+ ecode = zero_out(tdb,
+ next+sizeof(struct tdb_used_record),
+ sizeof(struct tdb_chain));
+ if (ecode != TDB_SUCCESS) {
+ return ecode;
+ }
+ ecode = tdb_write_off(tdb, subhash
+ + offsetof(struct tdb_chain,
+ next),
+ next);
+ if (ecode != TDB_SUCCESS) {
+ return ecode;
+ }