Use fsbridge for fopen and freopen

Abstracts away how a path is opened to a `FILE*`.

Reduces the number of places where path is converted to a string
for anything else but printing.
This commit is contained in:
Wladimir J. van der Laan
2017-03-01 16:28:39 +00:00
parent bac5c9cf64
commit 2a5f574762
5 changed files with 19 additions and 19 deletions

View File

@@ -89,7 +89,7 @@ bool CDBEnv::Open(const fs::path& pathIn)
dbenv->set_lg_max(1048576);
dbenv->set_lk_max_locks(40000);
dbenv->set_lk_max_objects(40000);
dbenv->set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
dbenv->set_errfile(fsbridge::fopen(pathErrorFile, "a")); /// debug
dbenv->set_flags(DB_AUTO_COMMIT, 1);
dbenv->set_flags(DB_TXN_WRITE_NOSYNC, 1);
dbenv->log_set_config(DB_LOG_AUTO_REMOVE, 1);