mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
autorid: reverse logic flow in idmap_autorid_init_hwm(), decreasing indentation.
I.e. move writing case to the end. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
70cfe221b0
commit
6ec437ccb5
@ -395,20 +395,24 @@ NTSTATUS idmap_autorid_init_hwm(struct db_context *db, const char *hwm)
|
||||
uint32_t hwmval;
|
||||
|
||||
status = dbwrap_fetch_uint32_bystring(db, hwm, &hwmval);
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
|
||||
status = dbwrap_trans_store_uint32_bystring(db, hwm, 0);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0,
|
||||
("Unable to initialise HWM (%s) in autorid "
|
||||
"database: %s\n", hwm, nt_errstr(status)));
|
||||
return NT_STATUS_INTERNAL_DB_ERROR;
|
||||
}
|
||||
} else if (!NT_STATUS_IS_OK(status)) {
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(1, ("HWM (%s) already initialized in autorid database "
|
||||
"(value %"PRIu32").\n", hwm, hwmval));
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
|
||||
DEBUG(0, ("unable to fetch HWM (%s) from autorid "
|
||||
"database: %s\n", hwm, nt_errstr(status)));
|
||||
return status;
|
||||
}
|
||||
|
||||
status = dbwrap_trans_store_uint32_bystring(db, hwm, 0);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0, ("Error initializing HWM (%s) in autorid database: "
|
||||
"%s\n", hwm, nt_errstr(status)));
|
||||
return NT_STATUS_INTERNAL_DB_ERROR;
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user