From mboxrd@z Thu Jan 1 00:00:00 1970 From: pcaulfield@sourceware.org Date: 3 Jul 2006 08:51:11 -0000 Subject: [Cluster-devel] cluster/cman/daemon cmanccs.c Message-ID: <20060703085111.18037.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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);