aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenremotestore/builds/buildstorageoperations.cpp23
2 files changed, 13 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca6008244..1ba91f439 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
- `--boost-worker-count` - Increase the number of worker threads - may cause computer to be less responsive
- `--boost-worker-memory` - Increase the limit where we write downloaded data to temporary storage to conserve space - may cause computer to be less responsive due to high memory usage
- `--boost-workers` - Enables both 'boost-worker-count' and 'boost-worker-memory' - may cause computer to be less responsive
+- Bugfix: Fixed warning due to calling std::filesystem::equivalent on a non-existing path (again)
## 5.7.14
- Improvement: asio http server now supports the `--dedicated` option which prevents port remapping
diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp
index 6c370f975..f07f410ea 100644
--- a/src/zenremotestore/builds/buildstorageoperations.cpp
+++ b/src/zenremotestore/builds/buildstorageoperations.cpp
@@ -2699,6 +2699,8 @@ BuildsOperationUpdateFolder::FindScavengeSources()
{
ZEN_TRACE_CPU("FindScavengeSources");
+ const bool TargetPathExists = IsDir(m_Path);
+
std::vector<std::filesystem::path> StatePaths = GetDownloadedStatePaths(m_Options.SystemRootDir);
std::vector<ScavengeSource> Result;
@@ -2710,19 +2712,18 @@ BuildsOperationUpdateFolder::FindScavengeSources()
try
{
- BuildsDownloadInfo Info = ReadDownloadedInfoFile(EntryPath);
- if (!Info.LocalPath.empty() || !IsDir(Info.LocalPath))
+ BuildsDownloadInfo Info = ReadDownloadedInfoFile(EntryPath);
+ const bool LocalPathExists = !Info.LocalPath.empty() && IsDir(Info.LocalPath);
+ const bool LocalStateFileExists = IsFile(Info.StateFilePath);
+ if (LocalPathExists && LocalStateFileExists)
{
- if (!std::filesystem::equivalent(Info.LocalPath, m_Path))
+ if (TargetPathExists && std::filesystem::equivalent(Info.LocalPath, m_Path))
{
- if (IsDir(Info.LocalPath) && IsFile(Info.StateFilePath))
- {
- Result.push_back({.StateFilePath = std::move(Info.StateFilePath), .Path = std::move(Info.LocalPath)});
- }
- else
- {
- DeleteEntry = true;
- }
+ DeleteEntry = true;
+ }
+ else
+ {
+ Result.push_back({.StateFilePath = std::move(Info.StateFilePath), .Path = std::move(Info.LocalPath)});
}
}
else