From ac3a06a8c1d5d898d582e015ee53ecd2ac4bad7d Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 17 Dec 2008 23:44:04 +0000 Subject: Handle package name changes in Fedora10: openais->corosync cman->cmanlib git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@727583 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Cpg.cpp | 5 ++++- cpp/src/qpid/cluster/Cpg.h | 4 ---- cpp/src/qpid/cluster/types.h | 10 +++++++++- cpp/src/tests/ais_check | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp index 0d7b15cfa8..48c3b483f9 100644 --- a/cpp/src/qpid/cluster/Cpg.cpp +++ b/cpp/src/qpid/cluster/Cpg.cpp @@ -69,7 +69,10 @@ int Cpg::getFd() { } Cpg::Cpg(Handler& h) : IOHandle(new sys::IOHandlePrivate), handler(h), isShutdown(false) { - cpg_callbacks_t callbacks = { &globalDeliver, &globalConfigChange }; + cpg_callbacks_t callbacks; + ::memset(&callbacks, sizeof(callbacks), 0); + callbacks.cpg_deliver_fn = &globalDeliver; + callbacks.cpg_confchg_fn = &globalConfigChange; check(cpg_initialize(&handle, &callbacks), "Cannot initialize CPG"); check(cpg_context_set(handle, this), "Cannot set CPG context"); // Note: CPG is currently unix-specific. If CPG is ported to diff --git a/cpp/src/qpid/cluster/Cpg.h b/cpp/src/qpid/cluster/Cpg.h index 2bd58cea1f..5de2b516d5 100644 --- a/cpp/src/qpid/cluster/Cpg.h +++ b/cpp/src/qpid/cluster/Cpg.h @@ -30,10 +30,6 @@ #include #include -extern "C" { -#include -} - namespace qpid { namespace cluster { diff --git a/cpp/src/qpid/cluster/types.h b/cpp/src/qpid/cluster/types.h index 3ee20c4692..857b19cc8a 100644 --- a/cpp/src/qpid/cluster/types.h +++ b/cpp/src/qpid/cluster/types.h @@ -22,8 +22,10 @@ * */ + #include "ClusterLeaveException.h" -#include +#include "config.h" +#include "qpid/Url.h" #include #include @@ -32,7 +34,13 @@ #include extern "C" { +#ifdef HAVE_OPENAIS_CPG_H #include +#elif HAVE_COROSYNC_CPG_H +# include +#else +# error "No cpg.h header file available" +#endif } namespace qpid { diff --git a/cpp/src/tests/ais_check b/cpp/src/tests/ais_check index f35010c9f6..5687110165 100755 --- a/cpp/src/tests/ais_check +++ b/cpp/src/tests/ais_check @@ -23,8 +23,8 @@ srcdir=`dirname $0` # Check AIS requirements and run tests if found. id -nG | grep '\' >/dev/null || \ NOGROUP="You are not a member of the ais group." -ps -u root | grep aisexec >/dev/null || \ - NOAISEXEC="The aisexec daemon is not running as root" +ps -u root | grep 'aisexec\|corosync' >/dev/null || \ + NOAISEXEC="The aisexec or corosync daemon is not running as root" if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then cat <