]> granicus.if.org Git - icinga2/commitdiff
Disable command pipe functionality on Windows.
authorGunnar Beutner <gunnar@beutner.name>
Tue, 22 Jan 2013 07:47:56 +0000 (08:47 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 22 Jan 2013 07:47:56 +0000 (08:47 +0100)
components/compat/compatcomponent.cpp
components/compat/compatcomponent.h

index 207a19e18f9cb70bab4c8c84d791689057306369..23fd6754cd55981afec207c207cdbfdbc1765c0b 100644 (file)
@@ -84,8 +84,10 @@ void CompatComponent::Start(void)
        m_StatusTimer->Start();
        m_StatusTimer->Reschedule(0);
 
+#ifndef _WIN32
        m_CommandThread = thread(boost::bind(&CompatComponent::CommandPipeThread, this, GetCommandPath()));
        m_CommandThread.detach();
+#endif /* _WIN32 */
 }
 
 /**
@@ -95,6 +97,7 @@ void CompatComponent::Stop(void)
 {
 }
 
+#ifndef _WIN32
 void CompatComponent::CommandPipeThread(const String& commandPath)
 {
        (void) unlink(commandPath.CStr());
@@ -178,6 +181,7 @@ void CompatComponent::ProcessCommand(const String& command)
        vector<String> argvExtra(argv.begin() + 1, argv.end());
        ExternalCommand::Execute(argv[0], argvExtra);
 }
+#endif /* _WIN32 */
 
 void CompatComponent::DumpHostStatus(ofstream& fp, const Host::Ptr& host)
 {
index fc06c91902a1f3a961f34110842c134932e21793..07486b6cc3aa5e56de0e4d7359ac4b996b5d7f2b 100644 (file)
@@ -33,16 +33,19 @@ public:
        virtual void Stop(void);
 
 private:
-       Timer::Ptr m_StatusTimer;
+#ifndef _WIN32
        thread m_CommandThread;
 
+       void CommandPipeThread(const String& commandPath);
+       void ProcessCommand(const String& command);
+#endif /* _WIN32 */
+
+       Timer::Ptr m_StatusTimer;
+
        String GetStatusPath(void) const;
        String GetObjectsPath(void) const;
        String GetCommandPath(void) const;
 
-       void CommandPipeThread(const String& commandPath);
-       void ProcessCommand(const String& command);
-
        void DumpHostStatus(ofstream& fp, const Host::Ptr& host);
        void DumpHostObject(ofstream& fp, const Host::Ptr& host);