Improve error messages for the Process class

This commit is contained in:
Gunnar Beutner 2014-11-13 08:53:12 +01:00
parent 6ef4e313d9
commit a14928ec10
1 changed files with 13 additions and 2 deletions

View File

@ -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 {