[Cluster-devel] cluster/cman/daemon cmanccs.c

pcaulfield at sourceware.org pcaulfield at sourceware.org
Mon Jul 3 08:51:11 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-07-03 08:51:10

Modified files:
	cman/daemon    : cmanccs.c 

Log message:
	Count votes correctly - buy not shadowing variables, sigh.
	Also fail to start if the nodeid is not set.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.16&r2=1.17

--- cluster/cman/daemon/cmanccs.c	2006/06/30 13:00:27	1.16
+++ cluster/cman/daemon/cmanccs.c	2006/07/03 08:51:10	1.17
@@ -506,12 +506,12 @@
 
 		error = ccs_get(cd, path, &str);
 		if (!error) {
-			int votes = atoi(str);
-			if (votes < 0 || votes > 255) {
+			int votestmp = atoi(str);
+			if (votestmp < 0 || votestmp > 255) {
 				log_msg(LOG_ERR, "invalid votes value %d", votes);
 				return -EINVAL;
 			}
-			votes = votes;
+			votes = votestmp;
 			free(str);
 		}
 		else {
@@ -537,6 +537,11 @@
 		}
 	}
 
+	if (!nodeid) {
+		log_msg(LOG_ERR, "No nodeid specified in cluster.conf");
+		return -EINVAL;
+	}
+
 	if (getenv("CMAN_MCAST_ADDR")) {
 		mcast_name = getenv("CMAN_MCAST_ADDR");
 		log_msg(LOG_INFO, "Using override multicast address %s\n", mcast_name);




More information about the Cluster-devel mailing list