Dont' use O_CLOEXEC on Windows, since it doesn't exist.

llvm-svn: 228590
This commit is contained in:
Zachary Turner 2015-02-09 19:13:46 +00:00
parent 20937be183
commit bf0f2b9b3a
1 changed files with 5 additions and 1 deletions

View File

@ -239,7 +239,11 @@ PseudoTerminal::Fork (char *error_str, size_t error_len)
error_str[0] = '\0';
pid_t pid = LLDB_INVALID_PROCESS_ID;
if (OpenFirstAvailableMaster (O_RDWR | O_CLOEXEC, error_str, error_len))
int flags = O_RDWR;
#if !defined(_MSC_VER)
flags |= O_CLOEXEC;
#endif
if (OpenFirstAvailableMaster (flags, error_str, error_len))
{
// Successfully opened our master pseudo terminal