diff options
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 64d8ef38f0..5cef2be07a 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -74,6 +74,7 @@ #include <memory> #include <optional> #include <string> +#include <system_error> #include <thread> #include <typeinfo> @@ -1061,13 +1062,9 @@ void ArgsManager::LogArgs() const bool RenameOver(fs::path src, fs::path dest) { -#ifdef WIN32 - return MoveFileExW(src.wstring().c_str(), dest.wstring().c_str(), - MOVEFILE_REPLACE_EXISTING) != 0; -#else - int rc = std::rename(src.c_str(), dest.c_str()); - return (rc == 0); -#endif /* WIN32 */ + std::error_code error; + fs::rename(src, dest, error); + return !error; } /** |