Skip to content
Snippets Groups Projects
Commit c85a7c24 authored by Brad King's avatar Brad King
Browse files

BUG: When more than one command is given and one of them fails to start and...

BUG: When more than one command is given and one of them fails to start and the rest are killed, do not forget to reap the killed children.
parent 3c16eac7
No related branches found
No related tags found
No related merge requests found
......@@ -1187,11 +1187,17 @@ static void kwsysProcessCleanup(kwsysProcess* cp, int error)
/* Kill any children already started. */
if(cp->ForkPIDs)
{
int status;
for(i=0; i < cp->NumberOfCommands; ++i)
{
if(cp->ForkPIDs[i])
{
/* Kill the child. */
kwsysProcessKill(cp->ForkPIDs[i]);
/* Reap the child. Keep trying until the call is not
interrupted. */
while((waitpid(cp->ForkPIDs[i], &status, 0) < 0) &&
(errno == EINTR));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment