From ecb044b679e99a651bffc9befebf11b5eaaf0c9f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 22 Jan 2013 08:47:56 +0100 Subject: [PATCH] Disable command pipe functionality on Windows. --- components/compat/compatcomponent.cpp | 4 ++++ components/compat/compatcomponent.h | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 207a19e18..23fd6754c 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -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 argvExtra(argv.begin() + 1, argv.end()); ExternalCommand::Execute(argv[0], argvExtra); } +#endif /* _WIN32 */ void CompatComponent::DumpHostStatus(ofstream& fp, const Host::Ptr& host) { diff --git a/components/compat/compatcomponent.h b/components/compat/compatcomponent.h index fc06c9190..07486b6cc 100644 --- a/components/compat/compatcomponent.h +++ b/components/compat/compatcomponent.h @@ -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); -- 2.50.1