return false;
off = tdb_read_off(tdb, off + offsetof(struct tdb_chain, next));
- if (off == TDB_OFF_ERR)
+ if (TDB_OFF_IS_ERR(off)) {
+ tdb->ecode = off;
return false;
+ }
if (off == 0)
return true;
(*num_found)++;
sizeof(tdb_off_t)
<< (group_bits + TDB_HASH_GROUP_BITS),
true);
- if (!hash)
+ if (TDB_PTR_IS_ERR(hash)) {
+ tdb->ecode = TDB_PTR_ERR(hash);
return false;
+ }
for (g = 0; g < (1 << group_bits); g++) {
const tdb_off_t *group = hash + (g << TDB_HASH_GROUP_BITS);
off + sizeof(rec),
key.dsize + data.dsize,
false);
- if (!key.dptr)
+ if (TDB_PTR_IS_ERR(key.dptr)) {
+ tdb->ecode = TDB_PTR_ERR(key.dptr);
goto fail;
+ }
data.dptr = key.dptr + key.dsize;
if (check(key, data, private_data) != 0)
goto fail;
h = bucket_off(ftable_off, i);
for (off = tdb_read_off(tdb, h); off; off = f.next) {
- if (off == TDB_OFF_ERR)
+ if (TDB_OFF_IS_ERR(off)) {
+ tdb->ecode = off;
return false;
+ }
ecode = tdb_read_convert(tdb, off, &f, sizeof(f));
if (ecode != TDB_SUCCESS) {
tdb->ecode = ecode;
enum TDB_ERROR ecode;
ecode = tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false);
- if (ecpde != TDB_SUCCESS) {
+ if (ecode != TDB_SUCCESS) {
tdb->ecode = ecode;
return -1;
}
goto fail;
for (ft = first_ftable(tdb); ft; ft = next_ftable(tdb, ft)) {
- if (ft == TDB_OFF_ERR)
+ if (TDB_OFF_IS_ERR(ft)) {
+ tdb->ecode = ft;
goto fail;
+ }
if (!check_free_table(tdb, ft, num_ftables, fr, num_free,
&num_found))
goto fail;