forked from OSchip/llvm-project
Stub out 'close' call on m_master_fd for Windows.
PseudoTerminal.cpp uses a dummy implementation of posix_openpt for Windows. This implementation just returns 0. So m_master_fd is 0. But destructor calls 'close' on m_master_fd. This 'close' calls seems un-necessary as m_master_fd was never opened in first place and calling 'close' on 0 can have other un-intended consequences. I am committing it as obvious as it is only a one-liner. Long term, we may want to refactor this class. llvm-svn: 220705
This commit is contained in:
parent
eae91040d8
commit
f289628178
|
@ -66,7 +66,11 @@ PseudoTerminal::CloseMasterFileDescriptor ()
|
||||||
{
|
{
|
||||||
if (m_master_fd >= 0)
|
if (m_master_fd >= 0)
|
||||||
{
|
{
|
||||||
|
// Don't call 'close' on m_master_fd for Windows as a dummy implementation of
|
||||||
|
// posix_openpt above always gives it a 0 value.
|
||||||
|
#ifndef _WIN32
|
||||||
::close (m_master_fd);
|
::close (m_master_fd);
|
||||||
|
#endif
|
||||||
m_master_fd = invalid_fd;
|
m_master_fd = invalid_fd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue