diff options
author | Brad King <brad.king@kitware.com> | 2005-04-19 15:52:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-04-19 15:52:25 (GMT) |
commit | c98bd6249a8b7b78be5621fbb55d97b9423da115 (patch) | |
tree | ba19c97c5449e4b4bd378e4a6faed36cc0b12847 | |
parent | f362d6e2ef1766425070e8dbfaa8a2fd668a988d (diff) | |
download | CMake-c98bd6249a8b7b78be5621fbb55d97b9423da115.zip CMake-c98bd6249a8b7b78be5621fbb55d97b9423da115.tar.gz CMake-c98bd6249a8b7b78be5621fbb55d97b9423da115.tar.bz2 |
BUG: When killing a child all the pipe read ends should be closed. This will allow a child that is blocking while waiting to write to the pipe to wake up and receive the kill signal properly on cygwin.
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 849f6b9..31e34ed 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -905,7 +905,6 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length, kwsysProcess_Kill(cp); cp->Killed = 0; cp->SelectError = 1; - cp->PipesLeft = 0; } } @@ -943,7 +942,6 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length, kwsysProcess_Kill(cp); cp->Killed = 0; cp->TimeoutExpired = 1; - cp->PipesLeft = 0; return kwsysProcess_Pipe_None; } } @@ -1076,6 +1074,13 @@ void kwsysProcess_Kill(kwsysProcess* cp) kwsysProcessKill(cp->ForkPIDs[i]); } } + + /* Close all the pipe read ends. */ + for(i=0; i < KWSYSPE_PIPE_COUNT; ++i) + { + kwsysProcessCleanupDescriptor(&cp->PipeReadEnds[i]); + } + cp->PipesLeft = 0; } /*--------------------------------------------------------------------------*/ |