diff options
author | Enrico Granata <egranata@apple.com> | 2016-01-20 23:20:10 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2016-01-20 23:20:10 +0000 |
commit | 35e0639018f3d57ae47bb8d0de5b6ef855cda450 (patch) | |
tree | 46a4a58bcced8564fc7f00ce38817c3a97027382 | |
parent | 760bef5e508c985bf9216d81adfc20a657d77611 (diff) | |
download | bcm5719-llvm-35e0639018f3d57ae47bb8d0de5b6ef855cda450.tar.gz bcm5719-llvm-35e0639018f3d57ae47bb8d0de5b6ef855cda450.zip |
Fix a problem where we were not calling fcntl() with the correct arguments for F_DUPFD
On Mac OS X, this was working just fine in debug builds (presumably, because the right value ended up being at the right location for the variadic ABI), but not in Release builds
As a result, we were seeing failures with commands that set their own immediate output stream - only in Release builds, which always makes for a fun little investigation
I have removed those fcntl() calls and replaced them with dup() calls. This fixes the issue in both Debug and Release builds
llvm-svn: 258367
-rw-r--r-- | lldb/source/Host/common/File.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp index a862f2cd433..99a87ac5c1a 100644 --- a/lldb/source/Host/common/File.cpp +++ b/lldb/source/Host/common/File.cpp @@ -191,7 +191,7 @@ File::GetStream () #ifdef _WIN32 m_descriptor = ::_dup(GetDescriptor()); #else - m_descriptor = ::fcntl(GetDescriptor(), F_DUPFD); + m_descriptor = dup(GetDescriptor()); #endif m_should_close_fd = true; } @@ -237,7 +237,7 @@ File::Duplicate (const File &rhs) #ifdef _WIN32 m_descriptor = ::_dup(rhs.GetDescriptor()); #else - m_descriptor = ::fcntl(rhs.GetDescriptor(), F_DUPFD); + m_descriptor = dup(rhs.GetDescriptor()); #endif if (!DescriptorIsValid()) error.SetErrorToErrno(); |