diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-11-20 11:34:24 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-11-20 11:34:39 +1100 |
commit | c99b3100632227dd32c11676b76343f2523cf0de (patch) | |
tree | 8623cf99172dcd33835e1ddbee2d35c92f3a57c1 | |
parent | 79a43fb74313d9ae88d72709e46ab385906af136 (diff) | |
download | samba-c99b3100632227dd32c11676b76343f2523cf0de.tar.gz samba-c99b3100632227dd32c11676b76343f2523cf0de.tar.bz2 samba-c99b3100632227dd32c11676b76343f2523cf0de.zip |
s4-ldb: when -v is specified, show progress of ldbadd/ldbmodify
This is useful for speed tests with large numbers of records.
-rw-r--r-- | source4/lib/ldb/tools/ldbadd.c | 5 | ||||
-rw-r--r-- | source4/lib/ldb/tools/ldbmodify.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/source4/lib/ldb/tools/ldbadd.c b/source4/lib/ldb/tools/ldbadd.c index f022486db8..a87c99aaee 100644 --- a/source4/lib/ldb/tools/ldbadd.c +++ b/source4/lib/ldb/tools/ldbadd.c @@ -35,6 +35,7 @@ #include "tools/cmdline.h" static int failures; +static struct ldb_cmdline *options; static void usage(void) { @@ -69,6 +70,9 @@ static int process_file(struct ldb_context *ldb, FILE *f, int *count) failures++; } else { (*count)++; + if (options->verbose) { + printf("Added %s\n", ldb_dn_get_linearized(ldif->msg->dn)); + } } ldb_ldif_read_free(ldb, ldif); } @@ -82,7 +86,6 @@ int main(int argc, const char **argv) { struct ldb_context *ldb; int i, ret=0, count=0; - struct ldb_cmdline *options; ldb = ldb_init(NULL, NULL); diff --git a/source4/lib/ldb/tools/ldbmodify.c b/source4/lib/ldb/tools/ldbmodify.c index d0bca0479b..4936880d09 100644 --- a/source4/lib/ldb/tools/ldbmodify.c +++ b/source4/lib/ldb/tools/ldbmodify.c @@ -35,6 +35,7 @@ #include "tools/cmdline.h" static int failures; +static struct ldb_cmdline *options; static void usage(void) { @@ -71,6 +72,9 @@ static int process_file(struct ldb_context *ldb, FILE *f, int *count) failures++; } else { (*count)++; + if (options->verbose) { + printf("Modified %s\n", ldb_dn_get_linearized(ldif->msg->dn)); + } } ldb_ldif_read_free(ldb, ldif); } @@ -83,7 +87,6 @@ int main(int argc, const char **argv) struct ldb_context *ldb; int count=0; int i, ret=LDB_SUCCESS; - struct ldb_cmdline *options; ldb = ldb_init(NULL, NULL); |