summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessUNIX.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-07-07 21:46:34 (GMT)
committerBrad King <brad.king@kitware.com>2004-07-07 21:46:34 (GMT)
commit55c1c3b33fceeb7be5d2c9557559585c919a4800 (patch)
treece31f5ab11584ee5829b97bb5952b3cc70b9cd31 /Source/kwsys/ProcessUNIX.c
parentae28d93a72850d5d48bc8e941af5e99c4f8f2202 (diff)
downloadCMake-55c1c3b33fceeb7be5d2c9557559585c919a4800.zip
CMake-55c1c3b33fceeb7be5d2c9557559585c919a4800.tar.gz
CMake-55c1c3b33fceeb7be5d2c9557559585c919a4800.tar.bz2
BUG: Do not disown if process has already been killed or the timeout expired. Also need to call kwsysProcessCleanup to disown.
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-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;
}