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/test/run-tdb1-3G-file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/tdb2/test/run-tdb1-3G-file.c') diff --git a/lib/tdb2/test/run-tdb1-3G-file.c b/lib/tdb2/test/run-tdb1-3G-file.c index 6509ca3ab7..fd66c047b1 100644 --- a/lib/tdb2/test/run-tdb1-3G-file.c +++ b/lib/tdb2/test/run-tdb1-3G-file.c @@ -11,7 +11,7 @@ static int tdb1_expand_file_sparse(struct tdb1_context *tdb, tdb1_off_t addition) { if (tdb->read_only || tdb->traverse_read) { - tdb->ecode = TDB1_ERR_RDONLY; + tdb->last_error = TDB_ERR_RDONLY; return -1; } @@ -27,8 +27,10 @@ static int tdb1_expand_file_sparse(struct tdb1_context *tdb, errno = ENOSPC; } if (written != 1) { - TDB1_LOG((tdb, TDB1_DEBUG_FATAL, "expand_file to %d failed (%s)\n", - size+addition, strerror(errno))); + tdb->last_error = tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR, + "expand_file to %d failed (%s)", + size+addition, + strerror(errno)); return -1; } } -- cgit