diff options
author | Michael Adam <obnox@samba.org> | 2011-10-06 21:29:04 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 15:51:00 +0200 |
commit | 67600117610eda2bd7ad2802bcc7a9147720e659 (patch) | |
tree | 1937d78a7dff356d404eb4bb9ba6109a408c4a41 /source3/lib | |
parent | c9bc1e492404077c6b40b5cefe33e859503a4227 (diff) | |
download | samba-67600117610eda2bd7ad2802bcc7a9147720e659.tar.gz samba-67600117610eda2bd7ad2802bcc7a9147720e659.tar.bz2 samba-67600117610eda2bd7ad2802bcc7a9147720e659.zip |
s3:dbwrap: change dbwrap_store_uint32() to NTSTATUS return type
for consistency and better error propagation
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Oct 11 15:51:00 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap/dbwrap.h | 3 | ||||
-rw-r--r-- | source3/lib/dbwrap/dbwrap_util.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h index f3e3bfe2d4..f0646d3ec1 100644 --- a/source3/lib/dbwrap/dbwrap.h +++ b/source3/lib/dbwrap/dbwrap.h @@ -76,7 +76,8 @@ NTSTATUS dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v); NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr, uint32_t *val); -int dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v); +NTSTATUS dbwrap_store_uint32(struct db_context *db, const char *keystr, + uint32_t v); NTSTATUS dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr, uint32_t *oldval, uint32_t change_val); NTSTATUS dbwrap_trans_change_uint32_atomic(struct db_context *db, diff --git a/source3/lib/dbwrap/dbwrap_util.c b/source3/lib/dbwrap/dbwrap_util.c index 31beadb6a2..48bd9bb13b 100644 --- a/source3/lib/dbwrap/dbwrap_util.c +++ b/source3/lib/dbwrap/dbwrap_util.c @@ -98,7 +98,8 @@ NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr, return NT_STATUS_OK; } -int dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v) +NTSTATUS dbwrap_store_uint32(struct db_context *db, const char *keystr, + uint32_t v) { struct db_record *rec; uint32 v_store; @@ -106,7 +107,7 @@ int dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v) rec = dbwrap_fetch_locked(db, NULL, string_term_tdb_data(keystr)); if (rec == NULL) { - return -1; + return NT_STATUS_INVALID_PARAMETER; } SIVAL(&v_store, 0, v); @@ -116,7 +117,7 @@ int dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v) sizeof(v_store)), TDB_REPLACE); TALLOC_FREE(rec); - return NT_STATUS_IS_OK(status) ? 0 : -1; + return status; } /** |