From ca7db1d420e8028f820a9b3512adfa4e2bae1a02 Mon Sep 17 00:00:00 2001 From: Tzigamm Date: Tue, 12 Oct 2021 10:06:52 +0200 Subject: [PATCH] Use fully qualified boost::filesystem identifiers. --- src/curecoinrpc.cpp | 12 ++++++------ src/db.cpp | 8 ++++---- src/init.cpp | 8 ++++---- src/main.cpp | 4 ++-- src/walletdb.cpp | 12 ++++++------ 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/curecoinrpc.cpp b/src/curecoinrpc.cpp index 0db74a5..7fa84ca 100644 --- a/src/curecoinrpc.cpp +++ b/src/curecoinrpc.cpp @@ -762,14 +762,14 @@ void ThreadRPCServer2(void* parg) { context.set_options(ssl::context::no_sslv2); - filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert")); - if (!pathCertFile.is_complete()) pathCertFile = filesystem::path(GetDataDir()) / pathCertFile; - if (filesystem::exists(pathCertFile)) context.use_certificate_chain_file(pathCertFile.string()); + boost::filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert")); + if (!pathCertFile.is_complete()) pathCertFile = boost::filesystem::path(GetDataDir()) / pathCertFile; + if (boost::filesystem::exists(pathCertFile)) context.use_certificate_chain_file(pathCertFile.string()); else printf("ThreadRPCServer ERROR: missing server certificate file %s\n", pathCertFile.string().c_str()); - filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem")); - if (!pathPKFile.is_complete()) pathPKFile = filesystem::path(GetDataDir()) / pathPKFile; - if (filesystem::exists(pathPKFile)) context.use_private_key_file(pathPKFile.string(), ssl::context::pem); + boost::filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem")); + if (!pathPKFile.is_complete()) pathPKFile = boost::filesystem::path(GetDataDir()) / pathPKFile; + if (boost::filesystem::exists(pathPKFile)) context.use_private_key_file(pathPKFile.string(), ssl::context::pem); else printf("ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string().c_str()); string strCiphers = GetArg("-rpcsslciphers", "TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH"); diff --git a/src/db.cpp b/src/db.cpp index 1463600..657c31b 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -69,11 +69,11 @@ bool CDBEnv::Open(boost::filesystem::path pathEnv_) return false; pathEnv = pathEnv_; - filesystem::path pathDataDir = pathEnv; + boost::filesystem::path pathDataDir = pathEnv; strPath = pathDataDir.string(); - filesystem::path pathLogDir = pathDataDir / "database"; - filesystem::create_directory(pathLogDir); - filesystem::path pathErrorFile = pathDataDir / "db.log"; + boost::filesystem::path pathLogDir = pathDataDir / "database"; + boost::filesystem::create_directory(pathLogDir); + boost::filesystem::path pathErrorFile = pathDataDir / "db.log"; printf("dbenv.open LogDir=%s ErrorFile=%s\n", pathLogDir.string().c_str(), pathErrorFile.string().c_str()); unsigned int nEnvFlags = 0; diff --git a/src/init.cpp b/src/init.cpp index bdc6847..62034b6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -523,7 +523,7 @@ bool AppInit2() return false; } - if (filesystem::exists(GetDataDir() / "wallet.dat")) + if (boost::filesystem::exists(GetDataDir() / "wallet.dat")) { CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover); if (r == CDBEnv::RECOVER_OK) @@ -834,13 +834,13 @@ bool AppInit2() } } - filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; - if (filesystem::exists(pathBootstrap)) { + boost::filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; + if (boost::filesystem::exists(pathBootstrap)) { uiInterface.InitMessage(_("Importing bootstrap blockchain data file.")); FILE *file = fopen(pathBootstrap.string().c_str(), "rb"); if (file) { - filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; + boost::filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; LoadExternalBlockFile(file); RenameOver(pathBootstrap, pathBootstrapOld); } diff --git a/src/main.cpp b/src/main.cpp index e443deb..ddd72ca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2542,7 +2542,7 @@ bool CBlock::CheckBlockSignature() const bool CheckDiskSpace(uint64 nAdditionalBytes) { - uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available; + uint64 nFreeBytesAvailable = boost::filesystem::space(GetDataDir()).available; // Check for nMinDiskSpace bytes (currently 50MB) if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes) @@ -2558,7 +2558,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes) return true; } -static filesystem::path BlockFilePath(unsigned int nFile) +static boost::filesystem::path BlockFilePath(unsigned int nFile) { string strBlockFn = strprintf("blk%04u.dat", nFile); return GetDataDir() / strBlockFn; diff --git a/src/walletdb.cpp b/src/walletdb.cpp index e0f0f25..b263dbc 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -637,20 +637,20 @@ bool BackupWallet(const CWallet& wallet, const string& strDest) bitdb.mapFileUseCount.erase(wallet.strWalletFile); // Copy wallet.dat - filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; - filesystem::path pathDest(strDest); - if (filesystem::is_directory(pathDest)) + boost::filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; + boost::filesystem::path pathDest(strDest); + if (boost::filesystem::is_directory(pathDest)) pathDest /= wallet.strWalletFile; try { #if BOOST_VERSION >= 104000 - filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists); + boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists); #else - filesystem::copy_file(pathSrc, pathDest); + boost::filesystem::copy_file(pathSrc, pathDest); #endif printf("copied wallet.dat to %s\n", pathDest.string().c_str()); return true; - } catch(const filesystem::filesystem_error &e) { + } catch(const boost::filesystem::filesystem_error &e) { printf("error copying wallet.dat to %s - %s\n", pathDest.string().c_str(), e.what()); return false; }