diff options
| author | tobtoht <tob@featherwallet.org> | 2025-01-18 11:09:43 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-01-18 11:09:43 +0000 |
| commit | e488bc838a73f238fb31084dad344350c005654e (patch) | |
| tree | 115189053a78e212f862812267a63b8d638d6c0a /src/common | |
| parent | 5625ea3a5663126cbf469e65609d2cc2f4f4dc0b (diff) | |
| parent | 36c5987156a31640c4638f1424b98285f6ea4a47 (diff) | |
| download | monzero-core-e488bc838a73f238fb31084dad344350c005654e.tar.gz monzero-core-e488bc838a73f238fb31084dad344350c005654e.tar.xz monzero-core-e488bc838a73f238fb31084dad344350c005654e.zip | |
Merge pull request #9705
36c5987 Fix get_database_size on Windows (iamamyth)
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/download.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/download.cpp b/src/common/download.cpp index 01d4a9aab..e377be266 100644 --- a/src/common/download.cpp +++ b/src/common/download.cpp @@ -30,7 +30,6 @@ #include <atomic> #include <boost/filesystem.hpp> #include <boost/thread/thread.hpp> -#include "file_io_utils.h" #include "net/http_client.h" #include "download.h" @@ -73,8 +72,11 @@ namespace tools { boost::unique_lock<boost::mutex> lock(control->mutex); std::ios_base::openmode mode = std::ios_base::out | std::ios_base::binary; - uint64_t existing_size = 0; - if (epee::file_io_utils::get_file_size(control->path, existing_size) && existing_size > 0) + boost::system::error_code ec{}; + uint64_t existing_size = static_cast<uint64_t>(boost::filesystem::file_size(control->path, ec)); + if (ec) + existing_size = 0; + if (existing_size > 0) { MINFO("Resuming downloading " << control->uri << " to " << control->path << " from " << existing_size); mode |= std::ios_base::app; |
