diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-12-29 12:50:47 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-12-29 10:12:05 +0100 |
commit | cac57328a6077dc428396402036636095f139569 (patch) | |
tree | ada85a847d12a29fe5246226cd08b1b6fda7b6e8 /lib/tdb/tools | |
parent | 9b31f6ab6cce55824f3e62f59061085abc1240db (diff) | |
download | samba-cac57328a6077dc428396402036636095f139569.tar.gz samba-cac57328a6077dc428396402036636095f139569.tar.bz2 samba-cac57328a6077dc428396402036636095f139569.zip |
tdb: tdb_summary() support.
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Dec 29 10:12:05 CET 2010 on sn-devel-104
Diffstat (limited to 'lib/tdb/tools')
-rw-r--r-- | lib/tdb/tools/tdbtool.c | 12 |
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) |