diff options
| -rw-r--r-- | lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp | 5 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index 329b7ea2360..7e0476caf9c 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -1629,9 +1629,12 @@ ProcessMonitor::StopMonitor() { StopMonitoringChildProcess(); StopOpThread(); - CloseFD(m_terminal_fd); CloseFD(m_client_fd); CloseFD(m_server_fd); + // Note: ProcessPOSIX passes the m_terminal_fd file descriptor to + // Process::SetSTDIOFileDescriptor, which in turn transfers ownership of + // the descriptor to a ConnectionFileDescriptor object. Consequently + // even though still has the file descriptor, we shouldn't close it here. } void diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index 2e6c55f45c9..3d175182a8a 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -2187,9 +2187,12 @@ ProcessMonitor::StopMonitor() { StopMonitoringChildProcess(); StopOpThread(); - CloseFD(m_terminal_fd); CloseFD(m_client_fd); CloseFD(m_server_fd); + // Note: ProcessPOSIX passes the m_terminal_fd file descriptor to + // Process::SetSTDIOFileDescriptor, which in turn transfers ownership of + // the descriptor to a ConnectionFileDescriptor object. Consequently + // even though still has the file descriptor, we shouldn't close it here. } void |

