diff options
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 4380b24..ff65474 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -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)); } } } |