[SCM] CTDB repository - branch master updated -
ctdb-1.0.57-35-gdc108ad
Ronnie Sahlberg
sahlberg at samba.org
Tue Oct 7 08:37:58 GMT 2008
The branch, master has been updated
via dc108adada33bb713f71a2859eda3b439ed0cd1a (commit)
via 5f96b33a379c80ed8a39de1ee41f254cf48733f9 (commit)
from 8e504fc8c01f750d1cb5d2289ef12c423daf1ad4 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit dc108adada33bb713f71a2859eda3b439ed0cd1a
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 7 19:34:34 2008 +1100
skip empty lines in the public addresses file, not skip all non-empty
lines
commit 5f96b33a379c80ed8a39de1ee41f254cf48733f9
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 7 19:25:10 2008 +1100
from Michael Adams : allow #-style comments in the nodes and public
addresses file
-----------------------------------------------------------------------
Summary of changes:
server/ctdb_server.c | 15 ++++++++++++++-
server/ctdb_takeover.c | 14 ++++++++++++--
2 files changed, 26 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/server/ctdb_server.c b/server/ctdb_server.c
index 19c8c2c..b41101d 100644
--- a/server/ctdb_server.c
+++ b/server/ctdb_server.c
@@ -158,7 +158,20 @@ int ctdb_set_nlist(struct ctdb_context *ctdb, const char *nlist)
}
for (i=0;i<nlines;i++) {
- if (ctdb_add_node(ctdb, lines[i]) != 0) {
+ char *node;
+
+ node = lines[i];
+ /* strip leading spaces */
+ while((*node == ' ') || (*node == '\t')) {
+ node++;
+ }
+ if (*node == '#') {
+ continue;
+ }
+ if (strcmp(node, "") == 0) {
+ continue;
+ }
+ if (ctdb_add_node(ctdb, node) != 0) {
talloc_free(lines);
return -1;
}
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index 8bdf308..483ab3c 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -451,9 +451,19 @@ int ctdb_set_public_addresses(struct ctdb_context *ctdb, const char *alist)
unsigned mask;
ctdb_sock_addr addr;
const char *iface;
- char *tok;
+ char *tok, *line;
- tok = strtok(lines[i], " \t");
+ line = lines[i];
+ while ((*line == ' ') || (*line == '\t')) {
+ line++;
+ }
+ if (*line == '#') {
+ continue;
+ }
+ if (strcmp(line, "") == 0) {
+ continue;
+ }
+ tok = strtok(line, " \t");
if (!tok || !parse_ip_mask(tok, &addr, &mask)) {
DEBUG(DEBUG_CRIT,("Badly formed line %u in public address list\n", i+1));
talloc_free(lines);
--
CTDB repository
More information about the samba-cvs
mailing list