cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] Small cman cleanup patches
@ 2007-10-23  4:49 Fabio M. Di Nitto
  2007-10-23  4:49 ` [Cluster-devel] [PATCH 1/3] Clean up duplicate ccs query paths Fabio M. Di Nitto
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio M. Di Nitto @ 2007-10-23  4:49 UTC (permalink / raw)
  To: cluster-devel.redhat.com


Hi guys,

3 patches to do some very small cleanup in cman/daemon/cmanccs.c.

Please apply or ACK and I will apply.

Thanks
Fabio

PS I know Patrick is away but they are all pretty safe changes.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH 1/3] Clean up duplicate ccs query paths.
  2007-10-23  4:49 [Cluster-devel] Small cman cleanup patches Fabio M. Di Nitto
@ 2007-10-23  4:49 ` Fabio M. Di Nitto
  2007-10-23  4:49   ` [Cluster-devel] [PATCH 2/3] Use right vars to print debugging info Fabio M. Di Nitto
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio M. Di Nitto @ 2007-10-23  4:49 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Fabio M. Di Nitto <fabbione@ubuntu.com>

Signed-off-by: Fabio M. Di Nitto <fabbione@ubuntu.com>
---
:100644 100644 33b5dd7... 0de3d0c... M	cman/daemon/cmanccs.c
 cman/daemon/cmanccs.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/cmanccs.c b/cman/daemon/cmanccs.c
index 33b5dd7..0de3d0c 100644
--- a/cman/daemon/cmanccs.c
+++ b/cman/daemon/cmanccs.c
@@ -45,7 +45,6 @@
 #define PORT_PATH		"/cluster/cman/@port"
 #define KEY_PATH		"/cluster/cman/@keyfile"
 
-#define NODEI_NAME_PATH		"/cluster/clusternodes/clusternode[%d]/@name"
 #define NODE_NAME_PATH_BYNAME	"/cluster/clusternodes/clusternode[@name=\"%s\"]/@name"
 #define NODE_NAME_PATH_BYNUM	"/cluster/clusternodes/clusternode[%d]/@name"
 #define NODE_VOTES_PATH		"/cluster/clusternodes/clusternode[@name=\"%s\"]/@votes"
@@ -500,7 +499,7 @@ static int get_ccs_join_info(void)
 		for (i = 1; ; i++) {
 			name = NULL;
 			memset(path, 0, MAX_PATH_LEN);
-			sprintf(path, NODEI_NAME_PATH, i);
+			sprintf(path, NODE_NAME_PATH_BYNUM, i);
 
 			error = ccs_get(cd, path, &name);
 			if (error || !name)
-- 
1.5.2.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH 2/3] Use right vars to print debugging info
  2007-10-23  4:49 ` [Cluster-devel] [PATCH 1/3] Clean up duplicate ccs query paths Fabio M. Di Nitto
@ 2007-10-23  4:49   ` Fabio M. Di Nitto
  2007-10-23  4:49     ` [Cluster-devel] [PATCH 3/3] Use standard path var and memset it before each query Fabio M. Di Nitto
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio M. Di Nitto @ 2007-10-23  4:49 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Fabio M. Di Nitto <fabbione@ubuntu.com>

Signed-off-by: Fabio M. Di Nitto <fabbione@ubuntu.com>
---
:100644 100644 0de3d0c... 6abc618... M	cman/daemon/cmanccs.c
 cman/daemon/cmanccs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cman/daemon/cmanccs.c b/cman/daemon/cmanccs.c
index 0de3d0c..6abc618 100644
--- a/cman/daemon/cmanccs.c
+++ b/cman/daemon/cmanccs.c
@@ -577,7 +577,7 @@ static int get_ccs_join_info(void)
 		if (!error) {
 			int votestmp = atoi(str);
 			if (votestmp < 0 || votestmp > 255) {
-				log_printf(LOG_ERR, "invalid votes value %d", votes);
+				log_printf(LOG_ERR, "invalid votes value %d", votestmp);
 				write_cman_pipe("Found invalid votes for node in CCS");
 				return -EINVAL;
 			}
-- 
1.5.2.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH 3/3] Use standard path var and memset it before each query
  2007-10-23  4:49   ` [Cluster-devel] [PATCH 2/3] Use right vars to print debugging info Fabio M. Di Nitto
@ 2007-10-23  4:49     ` Fabio M. Di Nitto
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio M. Di Nitto @ 2007-10-23  4:49 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Fabio M. Di Nitto <fabbione@ubuntu.com>

Signed-off-by: Fabio M. Di Nitto <fabbione@ubuntu.com>
---
:100644 100644 6abc618... 30bf039... M	cman/daemon/cmanccs.c
 cman/daemon/cmanccs.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/cman/daemon/cmanccs.c b/cman/daemon/cmanccs.c
index 6abc618..30bf039 100644
--- a/cman/daemon/cmanccs.c
+++ b/cman/daemon/cmanccs.c
@@ -130,24 +130,26 @@ int read_ccs_nodes(unsigned int *config_version, int check_nodeids)
 	two_node = 0;
 
     for (i=1;;i++) {
-	char nodekey[256];
-	char key[256];
+	char path[MAX_PATH_LEN];
 	int  votes=0, nodeid=0;
 
-	sprintf(nodekey, NODE_NAME_PATH_BYNUM, i);
-	error = ccs_get(ctree, nodekey, &nodename);
+	memset(path, 0, MAX_PATH_LEN);
+	sprintf(path, NODE_NAME_PATH_BYNUM, i);
+	error = ccs_get(ctree, path, &nodename);
 	if (error)
 	    break;
 
-	sprintf(key, NODE_VOTES_PATH, nodename);
-	if (!ccs_get(ctree, key, &str)) {
+	memset(path, 0, MAX_PATH_LEN);
+	sprintf(path, NODE_VOTES_PATH, nodename);
+	if (!ccs_get(ctree, path, &str)) {
 	    votes = atoi(str);
 	    free(str);
 	} else
 	    votes = 1;
 
-	sprintf(key, NODE_NODEID_PATH, nodename);
-	if (!ccs_get(ctree, key, &str))	{
+	memset(path, 0, MAX_PATH_LEN);
+	sprintf(path, NODE_NODEID_PATH, nodename);
+	if (!ccs_get(ctree, path, &str)) {
 	    nodeid = atoi(str);
 	    free(str);
 
-- 
1.5.2.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-23  4:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23  4:49 [Cluster-devel] Small cman cleanup patches Fabio M. Di Nitto
2007-10-23  4:49 ` [Cluster-devel] [PATCH 1/3] Clean up duplicate ccs query paths Fabio M. Di Nitto
2007-10-23  4:49   ` [Cluster-devel] [PATCH 2/3] Use right vars to print debugging info Fabio M. Di Nitto
2007-10-23  4:49     ` [Cluster-devel] [PATCH 3/3] Use standard path var and memset it before each query Fabio M. Di Nitto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).