Build fix for CentOS 5.9.

Fixes #4819
This commit is contained in:
Gunnar Beutner 2013-10-08 15:41:23 +02:00
parent d3314d5840
commit d36e2ebd1a
3 changed files with 16 additions and 0 deletions

View File

@ -348,7 +348,11 @@ void ClusterListener::OpenLogFile(void)
} }
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true); StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
#ifdef ZLIB
m_LogFile = boost::make_shared<ZlibStream>(logStream); m_LogFile = boost::make_shared<ZlibStream>(logStream);
#else /* ZLIB */
m_LogFile = logStream;
#endif /* ZLIB */
m_LogMessageCount = 0; m_LogMessageCount = 0;
m_LogMessageTimestamp = 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); std::fstream *fp = new std::fstream(path.CStr(), std::fstream::in);
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true); StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
#ifdef ZLIB
ZlibStream::Ptr lstream = boost::make_shared<ZlibStream>(logStream); ZlibStream::Ptr lstream = boost::make_shared<ZlibStream>(logStream);
#else /* ZLIB */
Stream::Ptr lstream = logStream;
#endif /* ZLIB */
String message; String message;
while (true) { while (true) {

View File

@ -21,6 +21,8 @@
#include "base/objectlock.h" #include "base/objectlock.h"
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#ifdef ZLIB
using namespace icinga; using namespace icinga;
extern "C" BIO_METHOD *BIO_f_zlib(void); extern "C" BIO_METHOD *BIO_f_zlib(void);
@ -76,3 +78,5 @@ bool ZlibStream::IsEof(void) const
return BIO_eof(m_BIO); return BIO_eof(m_BIO);
} }
#endif /* ZLIB */

View File

@ -24,6 +24,8 @@
#include "base/stream_bio.h" #include "base/stream_bio.h"
#include <iostream> #include <iostream>
#ifdef ZLIB
namespace icinga { namespace icinga {
class ZlibStream : public Stream class ZlibStream : public Stream
@ -48,4 +50,6 @@ private:
} }
#endif /* ZLIB */
#endif /* ZLIBSTREAM_H */ #endif /* ZLIBSTREAM_H */