Skip to content

Commit

Permalink
Make stdout-*.log readable (open in shared for reading mode) and non-…
Browse files Browse the repository at this point in the history
…buffered. (#335)
  • Loading branch information
mkhon authored Jan 27, 2022
1 parent f488e9f commit 488ba5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vcpkg/base/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,9 @@ namespace vcpkg
WriteFilePointer::WriteFilePointer(const Path& file_path, std::error_code& ec) noexcept
{
#if defined(_WIN32)
ec.assign(::_wfopen_s(&m_fs, to_stdfs_path(file_path).c_str(), L"wb"), std::generic_category());
m_fs = ::_wfsopen(to_stdfs_path(file_path).c_str(), L"wb", _SH_DENYWR);
ec.assign(m_fs == nullptr ? errno : 0, std::generic_category());
if (m_fs != nullptr) ::setvbuf(m_fs, NULL, _IONBF, 0);
#else // ^^^ _WIN32 / !_WIN32 vvv
m_fs = ::fopen(file_path.c_str(), "wb");
if (m_fs)
Expand Down

0 comments on commit 488ba5f

Please sign in to comment.