From e613effeae7c9373c9e635fc708ec2ce29661d4c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:32:13 +0930 Subject: tdb2: make TDB1 code use tdb2's TDB_ERROR and tdb_logerr() To do this, we make sure that the first few fields of tdb1_context and tdb_context are the same. This sweep also fixes up a few paths where we weren't setting tdb->ecode before our old logging function. Signed-off-by: Rusty Russell (Imported from CCAN commit 919937354a331bb964564a11b5a5b80403ff8db9) --- lib/tdb2/tdb1_summary.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/tdb2/tdb1_summary.c') diff --git a/lib/tdb2/tdb1_summary.c b/lib/tdb2/tdb1_summary.c index a2d2ae8f2f..b6889bc444 100644 --- a/lib/tdb2/tdb1_summary.c +++ b/lib/tdb2/tdb1_summary.c @@ -150,9 +150,11 @@ char *tdb1_summary(struct tdb1_context *tdb) tally1_add(&dead, rec.rec_len); break; default: - TDB1_LOG((tdb, TDB1_DEBUG_ERROR, - "Unexpected record magic 0x%x at offset %d\n", - rec.magic, off)); + tdb->last_error = tdb_logerr(tdb, TDB_ERR_CORRUPT, + TDB_LOG_ERROR, + "Unexpected record magic 0x%x" + " at offset %d", + rec.magic, off); goto unlock; } } -- cgit