From 7f25864db096e36eb8e3500a6044d0988075f1ae Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 29 Nov 2011 15:18:45 +1100 Subject: ctdb tool - move parsing of nodestring to where it is needed This puts the parsing and checking logic close together. This makes it easy to change the parsing code. Changed parsing code can now easily use both old client code and libctdb since both are guaranteed to be setup. Signed-off-by: Martin Schwenke (This used to be ctdb commit 57fb074a65dc56168fc3813b79a5bab4b3727cf3) --- ctdb/tools/ctdb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 1957617584..793e98f132 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -5310,15 +5310,6 @@ int main(int argc, const char *argv[]) signal(SIGALRM, ctdb_alarm); alarm(options.maxruntime); - /* setup the node number to contact */ - if (nodestring != NULL) { - if (strcmp(nodestring, "all") == 0) { - options.pnn = CTDB_BROADCAST_ALL; - } else { - options.pnn = strtoul(nodestring, NULL, 0); - } - } - control = extra_argv[0]; ev = event_context_init(NULL); @@ -5365,6 +5356,15 @@ int main(int argc, const char *argv[]) exit(1); } + /* setup the node number to contact */ + if (nodestring != NULL) { + if (strcmp(nodestring, "all") == 0) { + options.pnn = CTDB_BROADCAST_ALL; + } else { + options.pnn = strtoul(nodestring, NULL, 0); + } + } + /* verify the node exists */ verify_node(ctdb); -- cgit