From 67600117610eda2bd7ad2802bcc7a9147720e659 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 6 Oct 2011 21:29:04 +0200 Subject: s3:dbwrap: change dbwrap_store_uint32() to NTSTATUS return type for consistency and better error propagation Autobuild-User: Michael Adam Autobuild-Date: Tue Oct 11 15:51:00 CEST 2011 on sn-devel-104 --- source3/winbindd/idmap_tdb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index 339655f044..1d1ba64c21 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -251,7 +251,6 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db) static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom) { - int ret; uint32_t low_uid; uint32_t low_gid; bool update_uid = false; @@ -281,21 +280,21 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom) } if (update_uid) { - ret = dbwrap_store_uint32(ctx->db, HWM_USER, dom->low_id); - if (ret == -1) { + status = dbwrap_store_uint32(ctx->db, HWM_USER, dom->low_id); + if (!NT_STATUS_IS_OK(status)) { dbwrap_transaction_cancel(ctx->db); DEBUG(0, ("Unable to initialise user hwm in idmap " - "database\n")); + "database: %s\n", nt_errstr(status))); return NT_STATUS_INTERNAL_DB_ERROR; } } if (update_gid) { - ret = dbwrap_store_uint32(ctx->db, HWM_GROUP, dom->low_id); - if (ret == -1) { + status = dbwrap_store_uint32(ctx->db, HWM_GROUP, dom->low_id); + if (!NT_STATUS_IS_OK(status)) { dbwrap_transaction_cancel(ctx->db); DEBUG(0, ("Unable to initialise group hwm in idmap " - "database\n")); + "database: %s\n", nt_errstr(status))); return NT_STATUS_INTERNAL_DB_ERROR; } } -- cgit