From: Gunnar Beutner Date: Tue, 8 Oct 2013 13:41:23 +0000 (+0200) Subject: Build fix for CentOS 5.9. X-Git-Tag: v0.0.3~231 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d36e2ebd1a2ddd3f09b140c682fd15262c5027e1;p=icinga2 Build fix for CentOS 5.9. Fixes #4819 --- diff --git a/components/cluster/clusterlistener.cpp b/components/cluster/clusterlistener.cpp index 79c481e5c..ce86fb9b7 100644 --- a/components/cluster/clusterlistener.cpp +++ b/components/cluster/clusterlistener.cpp @@ -348,7 +348,11 @@ void ClusterListener::OpenLogFile(void) } StdioStream::Ptr logStream = boost::make_shared(fp, true); +#ifdef ZLIB m_LogFile = boost::make_shared(logStream); +#else /* ZLIB */ + m_LogFile = logStream; +#endif /* ZLIB */ m_LogMessageCount = 0; m_LogMessageTimestamp = 0; } @@ -431,7 +435,11 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr std::fstream *fp = new std::fstream(path.CStr(), std::fstream::in); StdioStream::Ptr logStream = boost::make_shared(fp, true); +#ifdef ZLIB ZlibStream::Ptr lstream = boost::make_shared(logStream); +#else /* ZLIB */ + Stream::Ptr lstream = logStream; +#endif /* ZLIB */ String message; while (true) { diff --git a/lib/base/zlibstream.cpp b/lib/base/zlibstream.cpp index 59b8bef4f..0159db118 100644 --- a/lib/base/zlibstream.cpp +++ b/lib/base/zlibstream.cpp @@ -21,6 +21,8 @@ #include "base/objectlock.h" #include +#ifdef ZLIB + using namespace icinga; extern "C" BIO_METHOD *BIO_f_zlib(void); @@ -76,3 +78,5 @@ bool ZlibStream::IsEof(void) const return BIO_eof(m_BIO); } + +#endif /* ZLIB */ diff --git a/lib/base/zlibstream.h b/lib/base/zlibstream.h index c7c040a88..0b3d7926a 100644 --- a/lib/base/zlibstream.h +++ b/lib/base/zlibstream.h @@ -24,6 +24,8 @@ #include "base/stream_bio.h" #include +#ifdef ZLIB + namespace icinga { class ZlibStream : public Stream @@ -48,4 +50,6 @@ private: } +#endif /* ZLIB */ + #endif /* ZLIBSTREAM_H */