From 55c1c3b33fceeb7be5d2c9557559585c919a4800 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 7 Jul 2004 17:46:34 -0400 Subject: BUG: Do not disown if process has already been killed or the timeout expired. Also need to call kwsysProcessCleanup to disown. --- Source/kwsys/ProcessUNIX.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- cgit v0.12