Output child pid to debug log when forking.

Fixes #5756

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
Gerd von Egidy 2014-03-13 23:03:59 +01:00 committed by Gunnar Beutner
parent 737675387d
commit 40b88422d2
1 changed files with 5 additions and 4 deletions

View File

@ -184,8 +184,6 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& callback)
#endif /* HAVE_PIPE2 */
// build argv
Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") + "'.");
char **argv = new char *[m_Arguments.size() + 1];
for (unsigned int i = 0; i < m_Arguments.size(); i++)
@ -193,8 +191,6 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& callback)
argv[m_Arguments.size()] = NULL;
m_Arguments.clear();
// build envp
int envc = 0;
@ -262,6 +258,11 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& callback)
// parent process
Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
"': PID " + Convert::ToString(m_Pid));
m_Arguments.clear();
// free arguments
for (int i = 0; argv[i] != NULL; i++)
free(argv[i]);