mirror of https://github.com/Icinga/icinga2.git
Improve error messages for the Process class
This commit is contained in:
parent
6ef4e313d9
commit
a14928ec10
|
@ -674,11 +674,22 @@ bool Process::DoEvents(void)
|
|||
Log(LogNotice, "Process")
|
||||
<< "PID " << m_PID << " (" << PrettyPrintArguments(m_Arguments) << ") terminated with exit code " << exitcode;
|
||||
} else if (WIFSIGNALED(status)) {
|
||||
int signum = WTERMSIG(status);
|
||||
char *zsigname = strsignal(signum);
|
||||
|
||||
String signame = Convert::ToString(signum);
|
||||
|
||||
if (zsigname) {
|
||||
signame += " (";
|
||||
signame += zsigname;
|
||||
signame += ")";
|
||||
}
|
||||
|
||||
Log(LogWarning, "Process")
|
||||
<< "PID " << m_PID << " was terminated by signal " << WTERMSIG(status);
|
||||
<< "PID " << m_PID << " was terminated by signal " << signame;
|
||||
|
||||
std::ostringstream outputbuf;
|
||||
outputbuf << "<Terminated by signal " << WTERMSIG(status) << ".>";
|
||||
outputbuf << "<Terminated by signal " << signame << ".>";
|
||||
output = output + outputbuf.str();
|
||||
exitcode = 128;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue