mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
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 <martin@meltin.net> (This used to be ctdb commit 57fb074a65dc56168fc3813b79a5bab4b3727cf3)
This commit is contained in:
parent
dbd452c801
commit
7f25864db0
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user