s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return type
[amitay/samba.git] / source3 / winbindd / idmap_tdb.c
index c19c9c81632c25cfb57a2f63cf34194018c1f5ad..339655f04455670a248d817eac4564f1a4c9d213 100644 (file)
@@ -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;
        }