diff options
author | Michael Adam <obnox@samba.org> | 2011-11-11 00:49:11 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-11-29 18:20:06 +0100 |
commit | efb993b686e397e06ba647089535c92ec08c4345 (patch) | |
tree | 470e5e6cd40991409f66e8ddcdac88cfce68fceb /source3/lib/dbwrap/dbwrap_rbt.c | |
parent | 819ca3b697e1b396b83308341cf81c19362c2626 (diff) | |
download | samba-efb993b686e397e06ba647089535c92ec08c4345.tar.gz samba-efb993b686e397e06ba647089535c92ec08c4345.tar.bz2 samba-efb993b686e397e06ba647089535c92ec08c4345.zip |
s3:dbwrap: turn the fetch dbwrap method to NTSTATUS return code.
This implement more correct NTSTATUS handling inside the backends.
This ensures that data.dptr != NULL if return code is NT_STATUS_OK.
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_rbt.c')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_rbt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/lib/dbwrap/dbwrap_rbt.c b/source3/lib/dbwrap/dbwrap_rbt.c index 98541eaf07..3f280c27de 100644 --- a/source3/lib/dbwrap/dbwrap_rbt.c +++ b/source3/lib/dbwrap/dbwrap_rbt.c @@ -344,8 +344,8 @@ static int db_rbt_parse_record(struct db_context *db, TDB_DATA key, return parser(res.key, res.val, private_data); } -static int db_rbt_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, - TDB_DATA key, TDB_DATA *data) +static NTSTATUS db_rbt_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, + TDB_DATA key, TDB_DATA *data) { uint8_t *result; struct db_rbt_search_result res; @@ -354,17 +354,17 @@ static int db_rbt_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, if (!found) { *data = tdb_null; - return 0; + return NT_STATUS_NOT_FOUND; } result = (uint8_t*)talloc_memdup(mem_ctx, res.val.dptr, res.val.dsize); if (result == NULL) { - return -1; + return NT_STATUS_NO_MEMORY; } data->dptr = result; data->dsize = res.val.dsize; - return 0; + return NT_STATUS_OK; } static int db_rbt_traverse_internal(struct rb_node *n, |