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/lib/sharesec.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'source3/lib/sharesec.c') diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index 9b3d5607fde..2c324cf971c 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -191,9 +191,11 @@ bool share_info_db_init(void) if ((vers_id == SHARE_DATABASE_VERSION_V1) || (IREV(vers_id) == SHARE_DATABASE_VERSION_V1)) { /* Written on a bigendian machine with old fetch_int code. Save as le. */ - if (dbwrap_store_int32(share_db, vstring, - SHARE_DATABASE_VERSION_V2) != 0) { - DEBUG(0, ("dbwrap_store_int32 failed\n")); + status = dbwrap_store_int32(share_db, vstring, + SHARE_DATABASE_VERSION_V2); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("dbwrap_store_int32 failed: %s\n", + nt_errstr(status))); goto cancel; } vers_id = SHARE_DATABASE_VERSION_V2; @@ -205,9 +207,11 @@ bool share_info_db_init(void) DEBUG(0, ("traverse failed\n")); goto cancel; } - if (dbwrap_store_int32(share_db, vstring, - SHARE_DATABASE_VERSION_V2) != 0) { - DEBUG(0, ("dbwrap_store_int32 failed\n")); + status = dbwrap_store_int32(share_db, vstring, + SHARE_DATABASE_VERSION_V2); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("dbwrap_store_int32 failed: %s\n", + nt_errstr(status))); goto cancel; } } @@ -219,9 +223,11 @@ bool share_info_db_init(void) DEBUG(0, ("traverse failed\n")); goto cancel; } - if (dbwrap_store_int32(share_db, vstring, - SHARE_DATABASE_VERSION_V3) != 0) { - DEBUG(0, ("dbwrap_store_int32 failed\n")); + status = dbwrap_store_int32(share_db, vstring, + SHARE_DATABASE_VERSION_V3); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("dbwrap_store_int32 failed: %s\n", + nt_errstr(status))); goto cancel; } -- cgit v1.2.1