From fa895c72832f9555b52d5bb1dba1093f73de3136 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 17 Jul 2024 08:54:52 +0200 Subject: [PATCH] mingw: Document mode wbx workaround --- src/node/blockstorage.cpp | 8 +++++++- src/test/streams_tests.cpp | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 8db5cbc9fd2..822f95ee91a 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -1164,7 +1164,13 @@ static auto InitBlocksdirXorKey(const BlockManager::Options& opts) xor_key_file >> xor_key; } else { // Create initial or missing xor key file - AutoFile xor_key_file{fsbridge::fopen(xor_key_path, "wbx")}; + AutoFile xor_key_file{fsbridge::fopen(xor_key_path, +#ifdef __MINGW64__ + "wb" // Temporary workaround for https://github.com/bitcoin/bitcoin/issues/30210 +#else + "wbx" +#endif + )}; xor_key_file << xor_key; } // If the user disabled the key, it must be zero. diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp index eed932b6d29..9296cbb41c4 100644 --- a/src/test/streams_tests.cpp +++ b/src/test/streams_tests.cpp @@ -30,8 +30,7 @@ BOOST_AUTO_TEST_CASE(xor_file) } { #ifdef __MINGW64__ - // Our usage of mingw-w64 and the msvcrt runtime does not support - // the x modifier for the _wfopen(). + // Temporary workaround for https://github.com/bitcoin/bitcoin/issues/30210 const char* mode = "wb"; #else const char* mode = "wbx";