Fix broken windows build due to use of O_CLOEXEC.

llvm-svn: 228171
This commit is contained in:
Zachary Turner
2015-02-04 19:11:48 +00:00
parent 5b266a8a23
commit 362a813736

View File

@@ -344,7 +344,14 @@ ProcessLaunchInfo::FinalizeFileActions (Target *target, bool default_to_use_pty)
log->Printf ("ProcessLaunchInfo::%s default_to_use_pty is set, and at least one stdin/stderr/stdout is unset, so generating a pty to use for it",
__FUNCTION__);
if (m_pty->OpenFirstAvailableMaster(O_RDWR | O_NOCTTY | O_CLOEXEC, NULL, 0))
int open_flags = O_RDWR | O_NOCTTY;
#if !defined(_MSC_VER)
// We really shouldn't be specifying platform specific flags
// that are intended for a system call in generic code. But
// this will have to do for now.
open_flags |= O_CLOEXEC;
#endif
if (m_pty->OpenFirstAvailableMaster(open_flags, NULL, 0))
{
const char *slave_path = m_pty->GetSlaveName(NULL, 0);