summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/ProcessUNIX.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index c91afb2..e02fbfb 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -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;
}