Rev 259: allow the events system to be chosen on the command line
in http://samba.org/~tridge/ctdb
tridge at samba.org
tridge at samba.org
Sat May 5 07:18:44 GMT 2007
------------------------------------------------------------
revno: 259
revision-id: tridge at samba.org-20070505071843-gdt3kgn66sa3xds0
parent: tridge at samba.org-20070505071806-hatj3yhl0nl335p3
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sat 2007-05-05 17:18:43 +1000
message:
allow the events system to be chosen on the command line
modified:
common/cmdline.c cmdline.c-20070416041216-w1zvz91bkdsgjckw-1
=== modified file 'common/cmdline.c'
--- a/common/cmdline.c 2007-05-03 01:06:24 +0000
+++ b/common/cmdline.c 2007-05-05 07:18:43 +0000
@@ -37,6 +37,7 @@
const char *db_dir;
int torture;
const char *logfile;
+ const char *events;
} ctdb_cmdline = {
.nlist = NULL,
.transport = "tcp",
@@ -45,11 +46,26 @@
.self_connect = 0,
.db_dir = NULL,
.torture = 0,
- .logfile = NULL
+ .logfile = NULL,
};
+enum {OPT_EVENTSYSTEM=1};
+
+static void ctdb_cmdline_callback(poptContext con,
+ enum poptCallbackReason reason,
+ const struct poptOption *opt,
+ const char *arg, const void *data)
+{
+ switch (opt->val) {
+ case OPT_EVENTSYSTEM:
+ event_set_default_backend(arg);
+ break;
+ }
+}
+
struct poptOption popt_ctdb_cmdline[] = {
+ { NULL, 0, POPT_ARG_CALLBACK, (void *)ctdb_cmdline_callback },
{ "nlist", 0, POPT_ARG_STRING, &ctdb_cmdline.nlist, 0, "node list file", "filename" },
{ "listen", 0, POPT_ARG_STRING, &ctdb_cmdline.myaddress, 0, "address to listen on", "address" },
{ "socket", 0, POPT_ARG_STRING, &ctdb_cmdline.socketname, 0, "local socket name", "filename" },
@@ -59,6 +75,7 @@
{ "dbdir", 0, POPT_ARG_STRING, &ctdb_cmdline.db_dir, 0, "directory for the tdb files", NULL },
{ "torture", 0, POPT_ARG_NONE, &ctdb_cmdline.torture, 0, "enable nastiness in library", NULL },
{ "logfile", 0, POPT_ARG_STRING, &ctdb_cmdline.logfile, 0, "log file location", "filename" },
+ { "events", 0, POPT_ARG_STRING, NULL, OPT_EVENTSYSTEM, "event system", NULL },
{ NULL }
};
More information about the samba-cvs
mailing list