diff options
Diffstat (limited to 'src/util/fs_helpers.cpp')
-rw-r--r-- | src/util/fs_helpers.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/util/fs_helpers.cpp b/src/util/fs_helpers.cpp index 4de8833a3f..8952f20f79 100644 --- a/src/util/fs_helpers.cpp +++ b/src/util/fs_helpers.cpp @@ -5,9 +5,7 @@ #include <util/fs_helpers.h> -#if defined(HAVE_CONFIG_H) -#include <config/bitcoin-config.h> -#endif +#include <config/bitcoin-config.h> // IWYU pragma: keep #include <logging.h> #include <sync.h> @@ -69,7 +67,7 @@ LockResult LockDirectory(const fs::path& directory, const fs::path& lockfile_nam } auto lock = std::make_unique<fsbridge::FileLock>(pathLockFile); if (!lock->TryLock()) { - error("Error while attempting to lock directory %s: %s", fs::PathToString(directory), lock->GetReason()); + LogError("Error while attempting to lock directory %s: %s\n", fs::PathToString(directory), lock->GetReason()); return LockResult::ErrorLock; } if (!probe_only) { @@ -249,20 +247,9 @@ fs::path GetSpecialFolderPath(int nFolder, bool fCreate) bool RenameOver(fs::path src, fs::path dest) { -#ifdef __MINGW64__ - // This is a workaround for a bug in libstdc++ which - // implements fs::rename with _wrename function. - // This bug has been fixed in upstream: - // - GCC 10.3: 8dd1c1085587c9f8a21bb5e588dfe1e8cdbba79e - // - GCC 11.1: 1dfd95f0a0ca1d9e6cbc00e6cbfd1fa20a98f312 - // For more details see the commits mentioned above. - return MoveFileExW(src.wstring().c_str(), dest.wstring().c_str(), - MOVEFILE_REPLACE_EXISTING) != 0; -#else std::error_code error; fs::rename(src, dest, error); return !error; -#endif } /** |