[llvm-branch-commits] [lldb] r270102 - Fix a problem where we were not calling fcntl() with the correct arguments for F_DUPFD
Francis Ricci via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 19 13:10:13 PDT 2016
Author: fjricci
Date: Thu May 19 15:10:13 2016
New Revision: 270102
URL: http://llvm.org/viewvc/llvm-project?rev=270102&view=rev
Log:
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
Modified:
lldb/branches/release_38/source/Host/common/File.cpp
Modified: lldb/branches/release_38/source/Host/common/File.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/Host/common/File.cpp?rev=270102&r1=270101&r2=270102&view=diff
==============================================================================
--- lldb/branches/release_38/source/Host/common/File.cpp (original)
+++ lldb/branches/release_38/source/Host/common/File.cpp Thu May 19 15:10:13 2016
@@ -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();
More information about the llvm-branch-commits
mailing list