From ded0ce8345b99e9d5e0cfaea7cee58648baea4b7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 29 Jul 2009 14:16:11 +0200 Subject: s3:dbwrap: change dbwrap_change_uint32_atomic() to return NTSTATUS not uint32_t. Michael --- source3/winbindd/idmap_tdb.c | 9 +++++---- source3/winbindd/idmap_tdb2.c | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index c42cd74cbe..ce7b6aa532 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -401,7 +401,7 @@ static NTSTATUS idmap_tdb_alloc_init( const char *params ) static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid) { - bool ret; + NTSTATUS ret; const char *hwmkey; const char *hwmtype; uint32_t high_hwm; @@ -449,10 +449,11 @@ static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid) /* fetch a new id and increment it */ ret = dbwrap_change_uint32_atomic(idmap_alloc_db, hwmkey, &hwm, 1); - if (ret != 0) { - DEBUG(0, ("Fatal error while fetching a new %s value\n!", hwmtype)); + if (!NT_STATUS_IS_OK(ret)) { + DEBUG(0, ("Fatal error while fetching a new %s value: %s\n!", + hwmtype, nt_errstr(ret))); idmap_alloc_db->transaction_cancel(idmap_alloc_db); - return NT_STATUS_UNSUCCESSFUL; + return ret; } /* recheck it is in the range */ diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 92e1db8460..8178fa0080 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -205,7 +205,6 @@ static NTSTATUS idmap_tdb2_allocate_id_action(struct db_context *db, void *private_data) { NTSTATUS ret; - uint32_t res; struct idmap_tdb2_allocate_id_context *state; uint32_t hwm; @@ -226,11 +225,10 @@ static NTSTATUS idmap_tdb2_allocate_id_action(struct db_context *db, } /* fetch a new id and increment it */ - res = dbwrap_change_uint32_atomic(db, state->hwmkey, &hwm, 1); - if (res == -1) { + ret = dbwrap_change_uint32_atomic(db, state->hwmkey, &hwm, 1); + if (!NT_STATUS_IS_OK(ret)) { DEBUG(1, ("Fatal error while fetching a new %s value\n!", state->hwmtype)); - ret = NT_STATUS_UNSUCCESSFUL; goto done; } -- cgit