Btw, the previous code must have failed to warn when exceeding the high_hwm,
because it overwrote hwm with the return value of the dbwrap_store_uint32(),
which does not return the hwm but 0 or -1, depending on success.
Michael
const char *hwmtype;
uint32_t hwm;
uint32_t high_hwm;
+ NTSTATUS ret;
/* Get current high water mark */
switch (xid->type) {
hwm = xid->id;
- if ((hwm = dbwrap_store_uint32(idmap_alloc_db, hwmkey, hwm)) == -1) {
- return NT_STATUS_INTERNAL_DB_ERROR;
- }
-
/* Warn if it is out of range */
if (hwm >= high_hwm) {
DEBUG(0, ("Warning: %s range full!! (max: %lu)\n",
hwmtype, (unsigned long)high_hwm));
}
- return NT_STATUS_OK;
+ ret = dbwrap_trans_store_uint32(idmap_alloc_db, hwmkey, hwm);
+
+ return ret;
}
/**********************************