mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-17 02:34:31 +02:00
parent
3a294bbd5d
commit
3ece2ba643
@ -200,10 +200,9 @@ static void TerminateAndWaitForEnd(pid_t target)
|
|||||||
|
|
||||||
int ret = kill(target, SIGTERM);
|
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);
|
Utility::Sleep(0.1);
|
||||||
ret = kill(target, SIGTERM);
|
ret = kill(target, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// timeout and the process still seems to live: kill it
|
// timeout and the process still seems to live: kill it
|
||||||
|
@ -42,6 +42,15 @@ void StreamLogger::Start(void)
|
|||||||
m_Tty = false;
|
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.
|
* Destructor for the StreamLogger class.
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
DECLARE_PTR_TYPEDEFS(StreamLogger);
|
DECLARE_PTR_TYPEDEFS(StreamLogger);
|
||||||
|
|
||||||
virtual void Start(void);
|
virtual void Start(void);
|
||||||
|
virtual void Stop(void);
|
||||||
~StreamLogger(void);
|
~StreamLogger(void);
|
||||||
|
|
||||||
void BindStream(std::ostream *stream, bool ownsStream);
|
void BindStream(std::ostream *stream, bool ownsStream);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user