BUG: fix extra close that killed cmake when being debugged

This commit is contained in:
Bill Hoffman 2008-09-04 17:02:25 -04:00
parent 4bf27d31fc
commit bf796f1434

View File

@ -715,18 +715,24 @@ bool cmWin32ProcessExecution::CloseHandles()
{ {
if(this->pStdErr != -1 ) if(this->pStdErr != -1 )
{ {
// this will close this as well: this->hChildStderrRdDup
_close(this->pStdErr); _close(this->pStdErr);
this->pStdErr = -1; this->pStdErr = -1;
this->hChildStderrRdDup = 0;
} }
if(this->pStdIn != -1 ) if(this->pStdIn != -1 )
{ {
// this will close this as well: this->hChildStdinWrDup
_close(this->pStdIn); _close(this->pStdIn);
this->pStdIn = -1; this->pStdIn = -1;
this->hChildStdinWrDup = 0;
} }
if(this->pStdOut != -1 ) if(this->pStdOut != -1 )
{ {
// this will close this as well: this->hChildStdoutRdDup
_close(this->pStdOut); _close(this->pStdOut);
this->pStdOut = -1; this->pStdOut = -1;
this->hChildStdoutRdDup = 0;
} }
bool ret = true; bool ret = true;
@ -735,21 +741,7 @@ bool cmWin32ProcessExecution::CloseHandles()
ret = false; ret = false;
} }
this->hChildStdinRd = 0; this->hChildStdinRd = 0;
if(this->hChildStdoutRdDup && !CloseHandle(this->hChildStdoutRdDup)) // now close these two
{
ret = false;
}
this->hChildStdoutRdDup = 0;
if(this->hChildStderrRdDup && !CloseHandle(this->hChildStderrRdDup))
{
ret = false;
}
this->hChildStderrRdDup = 0;
if(this->hChildStdinWrDup && !CloseHandle(this->hChildStdinWrDup))
{
ret = false;
}
this->hChildStdinWrDup = 0;
if (this->hChildStdoutWr && !CloseHandle(this->hChildStdoutWr)) if (this->hChildStdoutWr && !CloseHandle(this->hChildStdoutWr))
{ {
ret = false; ret = false;