mirror of https://github.com/Icinga/icinga2.git
parent
3a294bbd5d
commit
3ece2ba643
|
@ -200,10 +200,9 @@ static void TerminateAndWaitForEnd(pid_t target)
|
|||
|
||||
int ret = kill(target, SIGTERM);
|
||||
|
||||
while(Utility::GetTime() < timeout && (ret==0 || errno!=ESRCH))
|
||||
{
|
||||
while (Utility::GetTime() < timeout && (ret == 0 || errno != ESRCH)) {
|
||||
Utility::Sleep(0.1);
|
||||
ret = kill(target, SIGTERM);
|
||||
ret = kill(target, 0);
|
||||
}
|
||||
|
||||
// timeout and the process still seems to live: kill it
|
||||
|
|
|
@ -42,6 +42,15 @@ void StreamLogger::Start(void)
|
|||
m_Tty = false;
|
||||
}
|
||||
|
||||
void StreamLogger::Stop(void)
|
||||
{
|
||||
Logger::Stop();
|
||||
|
||||
// make sure we flush the log data on shutdown, even if we don't call the destructor
|
||||
if (m_Stream)
|
||||
m_Stream->flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor for the StreamLogger class.
|
||||
*/
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
DECLARE_PTR_TYPEDEFS(StreamLogger);
|
||||
|
||||
virtual void Start(void);
|
||||
virtual void Stop(void);
|
||||
~StreamLogger(void);
|
||||
|
||||
void BindStream(std::ostream *stream, bool ownsStream);
|
||||
|
|
Loading…
Reference in New Issue