Wean off TDB_ERRCODE.
[ccan] / ccan / tdb / freelistcheck.c
index efc050df9c65f8650bf0631fc394394c19501ac0..972b2a41c49e32f8d7ff479490702973f43ecc95 100644 (file)
@@ -67,7 +67,8 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
 
        /* Store the FREELIST_TOP record. */
        if (seen_insert(mem_tdb, last_ptr) == -1) {
-               ret = TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
+               tdb->ecode = TDB_ERR_CORRUPT;
+               ret = -1;
                goto fail;
        }
 
@@ -83,7 +84,8 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
                   be corrupt. */
 
                if (seen_insert(mem_tdb, rec_ptr)) {
-                       ret = TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
+                       tdb->ecode = TDB_ERR_CORRUPT;
+                       ret = -1;
                        goto fail;
                }