From 9b9aa556defbf35f782109464e4295d250e59f24 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:07:13 +0930 Subject: tdb2: fix internal tdb_write_convert() error handling in tdb_open() As noted, failtest was taking a long time, because a failure injected here was not detected. (Imported from CCAN commit 51f592dfcda4d58d6b9d8134b6e1aff791dc40f2) Signed-off-by: Rusty Russell --- lib/tdb2/open.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/tdb2') diff --git a/lib/tdb2/open.c b/lib/tdb2/open.c index 63076ec77f..43a9a2b40e 100644 --- a/lib/tdb2/open.c +++ b/lib/tdb2/open.c @@ -550,10 +550,11 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, /* Clear any features we don't understand. */ if ((open_flags & O_ACCMODE) != O_RDONLY) { hdr.features_used &= TDB_FEATURE_MASK; - if (tdb_write_convert(tdb, offsetof(struct tdb_header, - features_used), - &hdr.features_used, - sizeof(hdr.features_used)) == -1) + ecode = tdb_write_convert(tdb, offsetof(struct tdb_header, + features_used), + &hdr.features_used, + sizeof(hdr.features_used)); + if (ecode != TDB_SUCCESS) goto fail; } -- cgit