mirror of https://github.com/Icinga/icinga2.git
Disable command pipe functionality on Windows.
This commit is contained in:
parent
c20ae866b7
commit
ecb044b679
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue