mirror of
https://github.com/reactos/CMake.git
synced 2025-01-26 22:07:24 +00:00
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.
This commit is contained in:
parent
ccae106177
commit
8489a94101
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user