summaryrefslogtreecommitdiff
path: root/lib/tdb/tools
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb/tools')
-rw-r--r--lib/tdb/tools/tdbtool.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c
index 2ba7efc8ab..3511dc1e56 100644
--- a/lib/tdb/tools/tdbtool.c
+++ b/lib/tdb/tools/tdbtool.c
@@ -409,12 +409,14 @@ static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *
static void info_tdb(void)
{
- int count;
- total_bytes = 0;
- if ((count = tdb_traverse(tdb, traverse_fn, NULL)) == -1)
+ char *summary = tdb_summary(tdb);
+
+ if (!summary) {
printf("Error = %s\n", tdb_errorstr(tdb));
- else
- printf("%d records totalling %d bytes\n", count, total_bytes);
+ } else {
+ printf("%s", summary);
+ free(summary);
+ }
}
static void speed_tdb(const char *tlimit)