From bf0f2b9b3a0caa6e12ae1ef8e06bcaad9b5c9e77 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 9 Feb 2015 19:13:46 +0000 Subject: [PATCH] Dont' use O_CLOEXEC on Windows, since it doesn't exist. llvm-svn: 228590 --- lldb/source/Utility/PseudoTerminal.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp index 55d4a9a1fc1c..e728d4ab2a98 100644 --- a/lldb/source/Utility/PseudoTerminal.cpp +++ b/lldb/source/Utility/PseudoTerminal.cpp @@ -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