cluster/cman/daemon cmanccs.c
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.
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);