fs: consistently use fsbridge for fopen()

This commit is contained in:
fanquake
2021-12-24 16:44:57 +08:00
parent 486261dfcb
commit 5e8975e269
2 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@
#include <consensus/consensus.h> #include <consensus/consensus.h>
#include <core_io.h> #include <core_io.h>
#include <key_io.h> #include <key_io.h>
#include <fs.h>
#include <policy/policy.h> #include <policy/policy.h>
#include <policy/rbf.h> #include <policy/rbf.h>
#include <primitives/transaction.h> #include <primitives/transaction.h>
@ -158,7 +159,7 @@ static void RegisterLoad(const std::string& strInput)
std::string key = strInput.substr(0, pos); std::string key = strInput.substr(0, pos);
std::string filename = strInput.substr(pos + 1, std::string::npos); std::string filename = strInput.substr(pos + 1, std::string::npos);
FILE *f = fopen(filename.c_str(), "r"); FILE *f = fsbridge::fopen(filename.c_str(), "r");
if (!f) { if (!f) {
std::string strErr = "Cannot open file " + filename; std::string strErr = "Cannot open file " + filename;
throw std::runtime_error(strErr); throw std::runtime_error(strErr);

View File

@ -923,7 +923,7 @@ BOOST_AUTO_TEST_CASE(script_build)
} }
#ifdef UPDATE_JSON_TESTS #ifdef UPDATE_JSON_TESTS
FILE* file = fopen("script_tests.json.gen", "w"); FILE* file = fsbridge::fopen("script_tests.json.gen", "w");
fputs(strGen.c_str(), file); fputs(strGen.c_str(), file);
fclose(file); fclose(file);
#endif #endif