summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools/cmdline.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-22 04:16:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:41 -0500
commitd78ea3e34abd30fb388c4cc39e12611e211416a6 (patch)
tree4c111134a0850a7cd11283df50afd9484df8c8f3 /source4/lib/ldb/tools/cmdline.c
parentede8415d61b6791114c65de1c283a4e8c11f1585 (diff)
downloadsamba-d78ea3e34abd30fb388c4cc39e12611e211416a6.tar.gz
samba-d78ea3e34abd30fb388c4cc39e12611e211416a6.tar.bz2
samba-d78ea3e34abd30fb388c4cc39e12611e211416a6.zip
r10406: added --nosync option to all ldb tools, so that you can control if
transactions are synchronous or not on the command line. add LDB_FLG_NOSYNC flag to ldb_connect() so we can make our temporary ldb databases non-synchronous (This used to be commit dba41164e0c52f1e4351bd9057b16661cee3a822)
Diffstat (limited to 'source4/lib/ldb/tools/cmdline.c')
-rw-r--r--source4/lib/ldb/tools/cmdline.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c
index fb0292b7d9..7cdecc334f 100644
--- a/source4/lib/ldb/tools/cmdline.c
+++ b/source4/lib/ldb/tools/cmdline.c
@@ -55,6 +55,7 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const
{ "num-searches", 0, POPT_ARG_INT, &options.num_searches, 0, "number of test searches", NULL },
{ "num-records", 0, POPT_ARG_INT, &options.num_records, 0, "number of test records", NULL },
{ "all", 'a', POPT_ARG_NONE, &options.all_records, 0, "dn=*", NULL },
+ { "nosync", 0, POPT_ARG_NONE, &options.nosync, 0, "non-synchronous transactions", NULL },
{ "sorted", 'S', POPT_ARG_NONE, &options.sorted, 0, "sort attributes", NULL },
{ "sasl-mechanism", 0, POPT_ARG_STRING, &options.sasl_mechanism, 0, "choose SASL mechanism", "MECHANISM" },
{ "input", 'I', POPT_ARG_STRING, &options.input, 0, "Input File", "Input" },
@@ -159,7 +160,11 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const
}
if (strcmp(ret->url, "NONE") != 0) {
- if (ldb_connect(ldb, ret->url, 0, ret->options) != 0) {
+ int flags = 0;
+ if (options.nosync) {
+ flags |= LDB_FLG_NOSYNC;
+ }
+ if (ldb_connect(ldb, ret->url, flags, ret->options) != 0) {
fprintf(stderr, "Failed to connect to %s - %s\n",
ret->url, ldb_errstring(ldb));
goto failed;