summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-08-17 09:51:12 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:55 +0200
commit8f098a635f713652c4846d71e24c0a199c25b8b7 (patch)
tree5ec4f95af2f27b95da22a77c4c5fe7e7e101f138 /source3/lib
parent6608ba850b45e2f47cd1c2c4b1ad676150a1deea (diff)
downloadsamba-8f098a635f713652c4846d71e24c0a199c25b8b7.tar.gz
samba-8f098a635f713652c4846d71e24c0a199c25b8b7.tar.bz2
samba-8f098a635f713652c4846d71e24c0a199c25b8b7.zip
s3:dbwrap: change the dbwrap_traverse() wrapper to return the count in an additional parameter
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap.c14
-rw-r--r--source3/lib/dbwrap/dbwrap.h3
2 files changed, 14 insertions, 3 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;
}
diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h
index bceba6c2d4..7dda1bae52 100644
--- a/source3/lib/dbwrap/dbwrap.h
+++ b/source3/lib/dbwrap/dbwrap.h
@@ -65,7 +65,8 @@ TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
TDB_DATA key);
NTSTATUS dbwrap_traverse(struct db_context *db,
int (*f)(struct db_record*, void*),
- void *private_data);
+ void *private_data,
+ int *count);
/* The following definitions come from lib/dbwrap_util.c */