Build fixes for Windows.

This commit is contained in:
Gunnar Beutner 2012-08-03 18:17:47 +02:00
parent e795336611
commit 5641e521b0
8 changed files with 21 additions and 21 deletions

View File

@ -91,7 +91,7 @@
<ClInclude Include="nullchecktask.h" />
<ClInclude Include="service.h" />
<ClInclude Include="servicegroup.h" />
<ClInclude Include="checkresultmessage.h" />
<ClInclude Include="servicestatechangemessage.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="cib.cpp" />
@ -106,7 +106,7 @@
<ClCompile Include="nullchecktask.cpp" />
<ClCompile Include="service.cpp" />
<ClCompile Include="servicegroup.cpp" />
<ClCompile Include="checkresultmessage.cpp" />
<ClCompile Include="servicestatechangemessage.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -35,10 +35,10 @@
<ClInclude Include="servicegroup.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="checkresultmessage.h">
<ClInclude Include="nullchecktask.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="nullchecktask.h">
<ClInclude Include="servicestatechangemessage.h">
<Filter>Headerdateien</Filter>
</ClInclude>
</ItemGroup>
@ -64,14 +64,14 @@
<ClCompile Include="servicegroup.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="checkresultmessage.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="i2-cib.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="nullchecktask.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="servicestatechangemessage.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -86,7 +86,7 @@ void CIBSyncComponent::ServiceStateChangeRequestHandler(const Endpoint::Ptr& sen
//Service::OnCheckResultReceived(service, params);
//service->ApplyCheckResult(cr);
time_t now = Utility::GetTime();
time_t now = static_cast<time_t>(Utility::GetTime());
CIB::UpdateTaskStatistics(now, 1);
}

View File

@ -64,13 +64,13 @@ void CompatComponent::DumpHostStatus(ofstream& fp, const Host::Ptr& host)
<< "\t" << "check_latency=0" << "\n"
<< "\t" << "current_state=" << state << "\n"
<< "\t" << "state_type=1" << "\n"
<< "\t" << "last_check=" << time(NULL) << "\n"
<< "\t" << "next_check=" << time(NULL) << "\n"
<< "\t" << "last_check=" << Utility::GetTime() << "\n"
<< "\t" << "next_check=" << Utility::GetTime() << "\n"
<< "\t" << "current_attempt=1" << "\n"
<< "\t" << "max_attempts=1" << "\n"
<< "\t" << "active_checks_enabled=1" << "\n"
<< "\t" << "passive_checks_enabled=1" << "\n"
<< "\t" << "last_update=" << time(NULL) << "\n"
<< "\t" << "last_update=" << Utility::GetTime() << "\n"
<< "\t" << "}" << "\n"
<< "\n";
}
@ -192,7 +192,7 @@ void CompatComponent::StatusTimerHandler(void)
<< "\n";
statusfp << "info {" << "\n"
<< "\t" << "created=" << time(NULL) << "\n"
<< "\t" << "created=" << Utility::GetTime() << "\n"
<< "\t" << "version=2.0" << "\n"
<< "\t" << "}" << "\n"
<< "\n";

View File

@ -319,7 +319,7 @@ Endpoint::Ptr EndpointManager::GetEndpointByIdentity(const String& identity) con
void EndpointManager::SendAPIMessage(const Endpoint::Ptr& sender, const Endpoint::Ptr& recipient,
RequestMessage& message,
function<void(const EndpointManager::Ptr&, const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> callback, time_t timeout)
function<void(const EndpointManager::Ptr&, const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> callback, double timeout)
{
m_NextMessageID++;
@ -332,7 +332,7 @@ void EndpointManager::SendAPIMessage(const Endpoint::Ptr& sender, const Endpoint
PendingRequest pr;
pr.Request = message;
pr.Callback = callback;
pr.Timeout = time(NULL) + timeout;
pr.Timeout = Utility::GetTime() + timeout;
m_Requests[id] = pr;

View File

@ -57,7 +57,7 @@ public:
void SendMulticastMessage(const Endpoint::Ptr& sender, const RequestMessage& message);
void SendAPIMessage(const Endpoint::Ptr& sender, const Endpoint::Ptr& recipient, RequestMessage& message,
function<void(const EndpointManager::Ptr&, const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> callback, time_t timeout = 30);
function<void(const EndpointManager::Ptr&, const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> callback, double timeout = 30);
void ProcessResponseMessage(const Endpoint::Ptr& sender, const ResponseMessage& message);
@ -84,13 +84,13 @@ private:
*/
struct I2_ICINGA_API PendingRequest
{
time_t Timeout;
double Timeout;
RequestMessage Request;
function<void(const EndpointManager::Ptr&, const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> Callback;
bool HasTimedOut(void) const
{
return time(NULL) > Timeout;
return Utility::GetTime() > Timeout;
}
};

View File

@ -65,7 +65,7 @@ int IcingaApplication::Main(const vector<String>& args)
Logger::Write(LogInformation, "icinga", "Icinga component loader (version: " ICINGA_VERSION ")");
#endif /* _WIN32 */
time(&m_StartTime);
m_StartTime = Utility::GetTime();
if (args.size() < 2) {
stringstream msgbuf;
@ -242,7 +242,7 @@ Dictionary::Ptr IcingaApplication::GetMacros(void) const
return m_Macros;
}
time_t IcingaApplication::GetStartTime(void) const
double IcingaApplication::GetStartTime(void) const
{
return m_StartTime;
}

View File

@ -47,7 +47,7 @@ public:
String GetPidPath(void) const;
Dictionary::Ptr GetMacros(void) const;
time_t GetStartTime(void) const;
double GetStartTime(void) const;
static const String DefaultPidPath;
@ -59,7 +59,7 @@ private:
String m_PidPath;
Dictionary::Ptr m_Macros;
time_t m_StartTime;
double m_StartTime;
Timer::Ptr m_RetentionTimer;