Skip to content

Commit

Permalink
Assign ioError one time only.
Browse files Browse the repository at this point in the history
  • Loading branch information
herve-er committed May 2, 2024
1 parent 728ee7b commit 1408856
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libcommonserver/utility/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,14 +780,14 @@ bool Utility::checkIfDirEntryIsManaged(std::filesystem::recursive_directory_iter
ioError = IoErrorSuccess;

ItemType itemType;
if (!IoHelper::getItemType(dirIt->path(), itemType)) {
ioError = itemType.ioError;
bool result = IoHelper::getItemType(dirIt->path(), itemType);
ioError = itemType.ioError;
if (!result) {
LOGW_WARN(logger(), L"Error in IoHelper::getItemType: " << Utility::formatIoError(dirIt->path(), ioError).c_str());
return false;
}

if (itemType.ioError == IoErrorNoSuchFileOrDirectory || itemType.ioError == IoErrorAccessDenied) {
ioError = itemType.ioError;
LOGW_DEBUG(logger(), L"Error in IoHelper::getItemType: " << formatIoError(dirIt->path(), ioError).c_str());
return true;
}
Expand Down

0 comments on commit 1408856

Please sign in to comment.