]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
added daemon mode to ctdb_bench
authorAndrew Tridgell <tridge@samba.org>
Tue, 10 Apr 2007 04:46:32 +0000 (14:46 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 10 Apr 2007 04:46:32 +0000 (14:46 +1000)
(This used to be ctdb commit b1e71018866752d32f59170fd5c8ba01b05694d9)

ctdb/tests/ctdb_bench.c

index 023c76e7f9091c718134de26f6f8724b2705b003..368353877e36b2e5161a786ae70fd18d7d17ffe3 100644 (file)
@@ -200,6 +200,7 @@ int main(int argc, const char *argv[])
        const char *transport = "tcp";
        const char *myaddress = NULL;
        int self_connect=0;
+       int daemon_mode=0;
 
        struct poptOption popt_options[] = {
                POPT_AUTOHELP
@@ -207,6 +208,7 @@ int main(int argc, const char *argv[])
                { "listen", 0, POPT_ARG_STRING, &myaddress, 0, "address to listen on", "address" },
                { "transport", 0, POPT_ARG_STRING, &transport, 0, "protocol transport", NULL },
                { "self-connect", 0, POPT_ARG_NONE, &self_connect, 0, "enable self connect", "boolean" },
+               { "daemon", 0, POPT_ARG_NONE, &daemon_mode, 0, "spawn a ctdb daemon", "boolean" },
                { "timelimit", 't', POPT_ARG_INT, &timelimit, 0, "timelimit", "integer" },
                { "num-records", 'r', POPT_ARG_INT, &num_records, 0, "num_records", "integer" },
                { "num-msgs", 'n', POPT_ARG_INT, &num_msgs, 0, "num_msgs", "integer" },
@@ -254,6 +256,9 @@ int main(int argc, const char *argv[])
        if (self_connect) {
                ctdb_set_flags(ctdb, CTDB_FLAG_SELF_CONNECT);
        }
+       if (daemon_mode) {
+               ctdb_set_flags(ctdb, CTDB_FLAG_DAEMON_MODE);
+       }
 
        ret = ctdb_set_transport(ctdb, transport);
        if (ret == -1) {