Skip to contentSkip to conversation

cluster/cman/daemon cmanccs.c

Cluster-devel [email protected] 1 participant 1 message Jul 3, 2006

lore
Share & tools
lore
#0 lore raw

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

cman/daemon/cmanccs.c +8 -3
@@ -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);