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:
parent
ae28d93a72
commit
55c1c3b33f
|
@ -711,7 +711,8 @@ kwsysEXPORT void kwsysProcess_Disown(kwsysProcess* cp)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Make sure a detached child process is running. */
|
/* 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;
|
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;
|
cp->State = kwsysProcess_State_Disowned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue