More boost::filesystem failure checks

master
Ansariel 2021-08-30 13:59:36 +02:00
parent 9dee543ea3
commit ac70e21c93
1 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ void LLDiskCache::purge()
//for (auto& entry : boost::make_iterator_range(boost::filesystem::directory_iterator(cache_path, ec), {}))
for (auto& entry : boost::make_iterator_range(boost::filesystem::recursive_directory_iterator(cache_path, ec), {}))
{
if (boost::filesystem::is_regular_file(entry, ec) && !ec.failed())
if (!ec.failed() && (boost::filesystem::is_regular_file(entry, ec) && !ec.failed()))
{
if (entry.path().string().find(mCacheFilenamePrefix) != std::string::npos)
{
@ -485,7 +485,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
//for (auto& entry : boost::make_iterator_range(boost::filesystem::directory_iterator(dir_path, ec), {}))
for (auto& entry : boost::make_iterator_range(boost::filesystem::recursive_directory_iterator(dir_path, ec), {}))
{
if (boost::filesystem::is_regular_file(entry, ec) && !ec.failed())
if (!ec.failed() && (boost::filesystem::is_regular_file(entry, ec) && !ec.failed()))
{
if (entry.path().string().find(mCacheFilenamePrefix) != std::string::npos)
{