]> granicus.if.org Git - icinga2/commitdiff
Build fix for CentOS 5.9.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 8 Oct 2013 13:41:23 +0000 (15:41 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 8 Oct 2013 13:43:36 +0000 (15:43 +0200)
Fixes #4819

components/cluster/clusterlistener.cpp
lib/base/zlibstream.cpp
lib/base/zlibstream.h

index 79c481e5cad8188b9958fc3e7764062fd0aa9df2..ce86fb9b717cc4c635d95683ee85336d986c91a8 100644 (file)
@@ -348,7 +348,11 @@ void ClusterListener::OpenLogFile(void)
        }
 
        StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
+#ifdef ZLIB
        m_LogFile = boost::make_shared<ZlibStream>(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<StdioStream>(fp, true);
+#ifdef ZLIB
                        ZlibStream::Ptr lstream = boost::make_shared<ZlibStream>(logStream);
+#else /* ZLIB */
+                       Stream::Ptr lstream = logStream;
+#endif /* ZLIB */
 
                        String message;
                        while (true) {
index 59b8bef4fd140b50e5d30f4a2e99365328318f64..0159db118e8e2822cf7d9826d4d02133c14721af 100644 (file)
@@ -21,6 +21,8 @@
 #include "base/objectlock.h"
 #include <boost/make_shared.hpp>
 
+#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 */
index c7c040a880dd8b851a14834e6dbcd0ee450d2f68..0b3d7926a6c799ba1ce3088d06378c156b653f63 100644 (file)
@@ -24,6 +24,8 @@
 #include "base/stream_bio.h"
 #include <iostream>
 
+#ifdef ZLIB
+
 namespace icinga {
 
 class ZlibStream : public Stream
@@ -48,4 +50,6 @@ private:
 
 }
 
+#endif /* ZLIB */
+
 #endif /* ZLIBSTREAM_H */