]> granicus.if.org Git - icinga2/commitdiff
Build fixes for Windows.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 3 Aug 2012 16:17:47 +0000 (18:17 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 3 Aug 2012 16:17:47 +0000 (18:17 +0200)
cib/cib.vcxproj
cib/cib.vcxproj.filters
components/cibsync/cibsynccomponent.cpp
components/compat/compatcomponent.cpp
icinga/endpointmanager.cpp
icinga/endpointmanager.h
icinga/icingaapplication.cpp
icinga/icingaapplication.h

index f8a209ee3edeb7ef247f2d495bf71a17fe3b5513..4980e58626ad057075dd9b8f78a119c301307875 100644 (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" />
     <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">
index 2a3cfd9b58407a43e364bbbbaa2924353af0e463..009045a54271563773ecba362d48bc6c2cdbaeee 100644 (file)
     <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>
     <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>
\ No newline at end of file
index c65053d084df0b8013a45a24eece4f52bed292be..1088ff56bd92def7a14e9372ef2289c76ee0054b 100644 (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);
 }
 
index 3c7be2b1e5fc4c0683d1535e557ea9687e0646d2..c1c51e87157a190036267700eb57ea8361393d80 100644 (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";
index bda7176f0873bee06e492b1d21b7995be69cd8c9..1e7dc3a4a21dbdb657a7b05dc02a6765f1957902 100644 (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;
 
index 869a01922e671dc6f6ebcfb2c4ef29c42ca8add2..d8dd41f742198d3d955963f4d510d51f0f983a6a 100644 (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;
                }
        };
 
index 582dc79a51026ea649c506613798faba06033d72..bbe451ae4bdec50ec530f08a96646212db82017d 100644 (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;
 }
index 0bc10e4fd35944b072718db37be7ba02142d9cab..15ef8cb0f61e50631c5217d9fc3af1a9fe6c385e 100644 (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;