summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap.h3
-rw-r--r--source3/lib/dbwrap/dbwrap_util.c7
2 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h
index 423791660c..f3e3bfe2d4 100644
--- a/source3/lib/dbwrap/dbwrap.h
+++ b/source3/lib/dbwrap/dbwrap.h
@@ -72,7 +72,8 @@ NTSTATUS dbwrap_fetch_bystring(struct db_context *db, TALLOC_CTX *mem_ctx,
NTSTATUS dbwrap_fetch_int32(struct db_context *db, const char *keystr,
int32_t *result);
-int dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v);
+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);
diff --git a/source3/lib/dbwrap/dbwrap_util.c b/source3/lib/dbwrap/dbwrap_util.c
index bd29460f49..31beadb6a2 100644
--- a/source3/lib/dbwrap/dbwrap_util.c
+++ b/source3/lib/dbwrap/dbwrap_util.c
@@ -51,7 +51,8 @@ NTSTATUS dbwrap_fetch_int32(struct db_context *db, const char *keystr,
return NT_STATUS_OK;
}
-int dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v)
+NTSTATUS dbwrap_store_int32(struct db_context *db, const char *keystr,
+ int32_t v)
{
struct db_record *rec;
int32 v_store;
@@ -59,7 +60,7 @@ int dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v)
rec = dbwrap_fetch_locked(db, NULL, string_term_tdb_data(keystr));
if (rec == NULL) {
- return -1;
+ return NT_STATUS_UNSUCCESSFUL;
}
SIVAL(&v_store, 0, v);
@@ -69,7 +70,7 @@ int dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v)
sizeof(v_store)),
TDB_REPLACE);
TALLOC_FREE(rec);
- return NT_STATUS_IS_OK(status) ? 0 : -1;
+ return status;
}
NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr,