diff options
author | Hafiz Abid Qadeer <hafiz_abid@mentor.com> | 2014-10-27 19:27:00 +0000 |
---|---|---|
committer | Hafiz Abid Qadeer <hafiz_abid@mentor.com> | 2014-10-27 19:27:00 +0000 |
commit | f2896281784aa7a2e279559dc935a3250d85c2ca (patch) | |
tree | 4dbc3ff3810043e7c421b85de6e34a272c930ceb /lldb/source/Utility/PseudoTerminal.cpp | |
parent | eae91040d8cc4afbf4dce66acbfd32ad1e2b8975 (diff) | |
download | bcm5719-llvm-f2896281784aa7a2e279559dc935a3250d85c2ca.tar.gz bcm5719-llvm-f2896281784aa7a2e279559dc935a3250d85c2ca.zip |
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
Diffstat (limited to 'lldb/source/Utility/PseudoTerminal.cpp')
-rw-r--r-- | lldb/source/Utility/PseudoTerminal.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp index c906ea27300..f60c00aac02 100644 --- a/lldb/source/Utility/PseudoTerminal.cpp +++ b/lldb/source/Utility/PseudoTerminal.cpp @@ -66,7 +66,11 @@ PseudoTerminal::CloseMasterFileDescriptor () { 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); +#endif m_master_fd = invalid_fd; } } |