summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap/dbwrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap/dbwrap.c')
-rw-r--r--source3/lib/dbwrap/dbwrap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index f0d61a9a2f..614251c06f 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -111,8 +111,18 @@ NTSTATUS dbwrap_delete(struct db_context *db, TDB_DATA key)
NTSTATUS dbwrap_traverse(struct db_context *db,
int (*f)(struct db_record*, void*),
- void *private_data)
+ void *private_data,
+ int *count)
{
int ret = db->traverse(db, f, private_data);
- return (ret < 0) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK;
+
+ if (ret < 0) {
+ return NT_STATUS_INTERNAL_DB_CORRUPTION;
+ }
+
+ if (count != NULL) {
+ *count = ret;
+ }
+
+ return NT_STATUS_OK;
}