mirror of https://github.com/Icinga/icinga2.git
Fixed some compiler warnings.
This commit is contained in:
parent
df1199f206
commit
7835563e03
|
@ -94,13 +94,11 @@ void CompatIdoComponent::Start(void)
|
||||||
{
|
{
|
||||||
const int StatusTimerInterval = 60;
|
const int StatusTimerInterval = 60;
|
||||||
const int ConfigTimerInterval = 3600;
|
const int ConfigTimerInterval = 3600;
|
||||||
const int ProgramStatusTimerInterval = 15;
|
//const int ProgramStatusTimerInterval = 15;
|
||||||
const double ReconnectTimerInterval = GetReconnectInterval();
|
const double ReconnectTimerInterval = GetReconnectInterval();
|
||||||
|
|
||||||
/* FIXME - make this a config option when unix sockets are realdy */
|
/* FIXME - make this a config option when unix sockets are realdy */
|
||||||
|
|
||||||
bool IdoSocketType = true;
|
|
||||||
|
|
||||||
/* HINTS - XXX
|
/* HINTS - XXX
|
||||||
* - only tcp sockets
|
* - only tcp sockets
|
||||||
* - only icinga idoutils 1.8
|
* - only icinga idoutils 1.8
|
||||||
|
|
|
@ -26,8 +26,6 @@ static int I2Stream_free(BIO *bi);
|
||||||
static int I2Stream_read(BIO *bi, char *out, int outl);
|
static int I2Stream_read(BIO *bi, char *out, int outl);
|
||||||
static int I2Stream_write(BIO *bi, const char *in, int inl);
|
static int I2Stream_write(BIO *bi, const char *in, int inl);
|
||||||
static long I2Stream_ctrl(BIO *bi, int cmd, long num, void *ptr);
|
static long I2Stream_ctrl(BIO *bi, int cmd, long num, void *ptr);
|
||||||
static int I2Stream_gets(BIO *bi, char *buf, int size);
|
|
||||||
static int I2Stream_puts(BIO *bi, const char *str);
|
|
||||||
|
|
||||||
#define BIO_TYPE_I2STREAM (99|0x0400|0x0100)
|
#define BIO_TYPE_I2STREAM (99|0x0400|0x0100)
|
||||||
|
|
||||||
|
|
|
@ -82,17 +82,14 @@ void StreamLogger::ProcessLogEntry(ostream& stream, bool tty, const LogEntry& en
|
||||||
strftime(timestamp, sizeof(timestamp), "%Y/%m/%d %H:%M:%S %z", &tmnow);
|
strftime(timestamp, sizeof(timestamp), "%Y/%m/%d %H:%M:%S %z", &tmnow);
|
||||||
|
|
||||||
if (tty) {
|
if (tty) {
|
||||||
String colorCode;
|
|
||||||
switch (entry.Severity) {
|
switch (entry.Severity) {
|
||||||
case LogWarning:
|
case LogWarning:
|
||||||
colorCode = "\x1b[1;33m"; // yellow;
|
stream << "\x1b[1;33m"; // yellow;
|
||||||
break;
|
break;
|
||||||
case LogCritical:
|
case LogCritical:
|
||||||
colorCode = "\x1b[1;31m"; // red
|
stream << "\x1b[1;31m"; // red
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << colorCode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << "[" << timestamp << "] "
|
stream << "[" << timestamp << "] "
|
||||||
|
|
|
@ -31,7 +31,7 @@ bool I2_EXPORT TlsStream::m_SSLIndexInitialized = false;
|
||||||
* @param sslContext The SSL context for the client.
|
* @param sslContext The SSL context for the client.
|
||||||
*/
|
*/
|
||||||
TlsStream::TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr<SSL_CTX> sslContext)
|
TlsStream::TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr<SSL_CTX> sslContext)
|
||||||
: m_InnerStream(innerStream), m_Role(role), m_SSLContext(sslContext),
|
: m_InnerStream(innerStream), m_SSLContext(sslContext), m_Role(role),
|
||||||
m_SendQueue(boost::make_shared<FIFO>()), m_RecvQueue(boost::make_shared<FIFO>())
|
m_SendQueue(boost::make_shared<FIFO>()), m_RecvQueue(boost::make_shared<FIFO>())
|
||||||
{
|
{
|
||||||
m_InnerStream->OnDataAvailable.connect(boost::bind(&TlsStream::DataAvailableHandler, this));
|
m_InnerStream->OnDataAvailable.connect(boost::bind(&TlsStream::DataAvailableHandler, this));
|
||||||
|
|
|
@ -198,8 +198,6 @@ void DowntimeProcessor::AddDowntimesToCache(const DynamicObject::Ptr& owner)
|
||||||
String id;
|
String id;
|
||||||
Dictionary::Ptr downtime;
|
Dictionary::Ptr downtime;
|
||||||
BOOST_FOREACH(tie(id, downtime), downtimes) {
|
BOOST_FOREACH(tie(id, downtime), downtimes) {
|
||||||
double end_time = downtime->Get("end_time");
|
|
||||||
|
|
||||||
int legacy_id = downtime->Get("legacy_id");
|
int legacy_id = downtime->Get("legacy_id");
|
||||||
|
|
||||||
if (legacy_id >= m_NextDowntimeID)
|
if (legacy_id >= m_NextDowntimeID)
|
||||||
|
|
|
@ -141,10 +141,10 @@ void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const vect
|
||||||
result->Set("state", PluginCheckTask::ExitStatusToState(exitStatus));
|
result->Set("state", PluginCheckTask::ExitStatusToState(exitStatus));
|
||||||
|
|
||||||
double now = Utility::GetTime();
|
double now = Utility::GetTime();
|
||||||
result->Set("schedule_start", time);
|
result->Set("schedule_start", now);
|
||||||
result->Set("schedule_end", time);
|
result->Set("schedule_end", now);
|
||||||
result->Set("execution_start", time);
|
result->Set("execution_start", now);
|
||||||
result->Set("execution_end", time);
|
result->Set("execution_end", now);
|
||||||
result->Set("active", 0);
|
result->Set("active", 0);
|
||||||
|
|
||||||
Logger::Write(LogInformation, "icinga", "Processing passive check result for service '" + arguments[1] + "'");
|
Logger::Write(LogInformation, "icinga", "Processing passive check result for service '" + arguments[1] + "'");
|
||||||
|
|
|
@ -28,8 +28,6 @@ void NullCheckTask::ScriptFunc(const ScriptTask::Ptr& task, const vector<Value>&
|
||||||
if (arguments.size() < 1)
|
if (arguments.size() < 1)
|
||||||
throw_exception(invalid_argument("Missing argument: Service must be specified."));
|
throw_exception(invalid_argument("Missing argument: Service must be specified."));
|
||||||
|
|
||||||
double now = Utility::GetTime();
|
|
||||||
|
|
||||||
Dictionary::Ptr cr = boost::make_shared<Dictionary>();
|
Dictionary::Ptr cr = boost::make_shared<Dictionary>();
|
||||||
cr->Set("state", StateUnknown);
|
cr->Set("state", StateUnknown);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue