diff --git a/lldb/source/Host/windows/FileSystem.cpp b/lldb/source/Host/windows/FileSystem.cpp --- a/lldb/source/Host/windows/FileSystem.cpp +++ b/lldb/source/Host/windows/FileSystem.cpp @@ -101,6 +101,8 @@ std::wstring wpath; if (!llvm::ConvertUTF8toWide(path, wpath)) return -1; + // All other bits are rejected by _wsopen_s + mode = mode & (_S_IREAD | _S_IWRITE); int result; ::_wsopen_s(&result, wpath.c_str(), flags, _SH_DENYNO, mode); return result;