From b77f41d58b05101e02d8ac0e54cb0e30807d89c2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 22 Oct 2009 00:09:43 +1030 Subject: lib/tdb: wean off TDB_ERRCODE. It was a regrettable hack which I used to reduce line count in tdb; in fact it caused confusion as can be seen in this patch. In particular, ecode now needs to be set before TDB_LOG anyway, and having it exposed in the header is useless (the struct tdb_context isn't defined, so it's doubly useless). Also, we should never set errno, as io.c was doing. Signed-off-by: Rusty Russell --- lib/tdb/common/freelistcheck.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/tdb/common/freelistcheck.c') diff --git a/lib/tdb/common/freelistcheck.c b/lib/tdb/common/freelistcheck.c index efc050df9c..972b2a41c4 100644 --- a/lib/tdb/common/freelistcheck.c +++ b/lib/tdb/common/freelistcheck.c @@ -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; } -- cgit