Skip to content

Commit b245ed6

Browse files
committed
Use binary mode files for flat node files on Windows
1 parent 4493319 commit b245ed6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node-persistent-cache.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ node_persistent_cache::node_persistent_cache(std::string file_name,
4141
flags |= O_CREAT; // NOLINT(hicpp-signed-bitwise)
4242
}
4343

44+
#ifdef _WIN32
45+
flags |= O_BINARY; // NOLINT(hicpp-signed-bitwise)
46+
#endif
47+
4448
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
4549
m_fd = open(m_file_name.c_str(), flags, 0644);
4650
if (m_fd < 0) {

0 commit comments

Comments
 (0)