mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 08:08:24 -05:00
BUG: Do not disown if process has already been killed or the timeout expired. Also need to call kwsysProcessCleanup to disown.
This commit is contained in:
@@ -711,7 +711,8 @@ kwsysEXPORT void kwsysProcess_Disown(kwsysProcess* cp)
|
||||
int i;
|
||||
|
||||
/* Make sure a detached child process is running. */
|
||||
if(!cp || !cp->Detached || cp->State != kwsysProcess_State_Executing)
|
||||
if(!cp || !cp->Detached || cp->State != kwsysProcess_State_Executing ||
|
||||
cp->TimeoutExpired || cp->Killed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -740,6 +741,10 @@ kwsysEXPORT void kwsysProcess_Disown(kwsysProcess* cp)
|
||||
}
|
||||
}
|
||||
|
||||
/* We will not wait for exit, so cleanup now. */
|
||||
kwsysProcessCleanup(cp, 0);
|
||||
|
||||
/* The process has been disowned. */
|
||||
cp->State = kwsysProcess_State_Disowned;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user