build: make --disable-testagents work

The --disable-testagents option sets enable_testagents to "no". This
variable should always be explicitly tested against "yes", not just
that it is non-empty.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Handle ERANGE from getpwnam_r / getgrnam_r

These functions return ERANGE if the supplied buffer is too small to
fit a line.  Try doubling the buffer a few times until it works.
Convert the nodeid byte order to be aligned with network order

When using corosync with clear_node_high_bit setting to yes,
the highest bit is cleared.  When all the cluster nodes are in
one subnet, we probably configure the IP addresses as follows:

node1: 147.2.207.64
node2: 147.2.207.192

If the byte order of the nodeid is little endian, wiping off the
highest bit will make the two nodes have the same nodeid!

This patch fixes this by converting the nodeid to network order.

Signed-off-by: Xia Li <xli@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
cts: Output nodeid consistently as unsigned int

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
cfgtool: Retry shutdown on CS_ERR_TRY_AGAIN

It may be nice to deliver macro cs_repeat as default in some include
file.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
totempg: Make iov_delv local variable

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Make cts work with pacemaker 1.1.9

This is counterpart of adcc21a30c70a40861736bc9d902c2ef2d4b42c4 in
pacemaker.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Improved POSIX-compliant handling of getpwnam_r() and getgrnam_r().

Signed-off-by: Andrei Belov <defanator@gmail.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
build: pass enable options to "make rpm" from configure

Signed-off-by: Yuichi SEINO <seino.cluster2@gmail.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Support for numerical uid/gid

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Added checks for "--as-needed" and "--version-script" linker flags.

This makes possible to build Corosync from sources on SunOS 5.11,
Mac OS X 10.8.3 and probably other systems with non-GNU linker.

Signed-off-by: Andrei Belov <defanator@gmail.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Detect big scheduling pauses

Add poll timer scheduler to be called 3 times per token timeout.
If poll timer was not called for more then 0.8 * token timeout, it means
corosync process was not scheduled and ether token_timeout should be
increased or load should be reduced (useful for VM, where host is
overcommitted so VM is not scheduled as expected).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>