diff options
author | Volker Lendecke <vl@samba.org> | 2011-12-08 15:50:33 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-12-15 16:00:45 +0100 |
commit | 26fc72921f7b72dfebfe8394baa85b81ef66d26d (patch) | |
tree | ad66ef76af07e27e13a956ff79431ce80590b97c /source3/lib/dbwrap/dbwrap_rbt.c | |
parent | 19078b9b0564ed2654a1dae1d23488f89aadb41f (diff) | |
download | samba-26fc72921f7b72dfebfe8394baa85b81ef66d26d.tar.gz samba-26fc72921f7b72dfebfe8394baa85b81ef66d26d.tar.bz2 samba-26fc72921f7b72dfebfe8394baa85b81ef66d26d.zip |
s3-dbwrap: Make dbwrap_parse_record return NTSTATUS
Also, the parser now returns void. The parser is called if and only if
dbwrap_parse_record returns NT_STATUS_OK.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_rbt.c')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_rbt.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/lib/dbwrap/dbwrap_rbt.c b/source3/lib/dbwrap/dbwrap_rbt.c index 3f280c27de..09bc210f9e 100644 --- a/source3/lib/dbwrap/dbwrap_rbt.c +++ b/source3/lib/dbwrap/dbwrap_rbt.c @@ -330,18 +330,19 @@ static int db_rbt_wipe(struct db_context *db) return 0; } -static int db_rbt_parse_record(struct db_context *db, TDB_DATA key, - int (*parser)(TDB_DATA key, TDB_DATA data, - void *private_data), - void *private_data) +static NTSTATUS db_rbt_parse_record(struct db_context *db, TDB_DATA key, + void (*parser)(TDB_DATA key, TDB_DATA data, + void *private_data), + void *private_data) { struct db_rbt_search_result res; bool found = db_rbt_search_internal(db, key, &res); if (!found) { - return -1; + return NT_STATUS_NOT_FOUND; } - return parser(res.key, res.val, private_data); + parser(res.key, res.val, private_data); + return NT_STATUS_OK; } static NTSTATUS db_rbt_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, |