From c9bc1e492404077c6b40b5cefe33e859503a4227 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 6 Oct 2011 21:24:07 +0200 Subject: s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return type for consistency and better error propagation --- source3/winbindd/idmap_tdb.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index c19c9c8163..339655f044 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -197,8 +197,10 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db) wm = dom->low_id; } - if (dbwrap_store_int32(db, HWM_USER, wm) == -1) { - DEBUG(0, ("Unable to byteswap user hwm in idmap database\n")); + status = dbwrap_store_int32(db, HWM_USER, wm); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Unable to byteswap user hwm in idmap " + "database: %s\n", nt_errstr(status))); return False; } @@ -213,8 +215,10 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db) wm = dom->low_id; } - if (dbwrap_store_int32(db, HWM_GROUP, wm) == -1) { - DEBUG(0, ("Unable to byteswap group hwm in idmap database\n")); + status = dbwrap_store_int32(db, HWM_GROUP, wm); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Unable to byteswap group hwm in idmap " + "database: %s\n", nt_errstr(status))); return False; } } @@ -235,8 +239,10 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db) return False; } - if (dbwrap_store_int32(db, "IDMAP_VERSION", IDMAP_VERSION) == -1) { - DEBUG(0, ("Unable to store idmap version in database\n")); + status = dbwrap_store_int32(db, "IDMAP_VERSION", IDMAP_VERSION); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Unable to store idmap version in database: %s\n", + nt_errstr(status))); return False; } -- cgit