summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-04-16 09:25:40 +0300
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-04-16 09:25:40 +0300
commit492efd6678f2f9db8d66b0bde5136bc1e5740cbb (patch)
treec1487be98dffe4713d102656fdde6390e13bac5b /indra
parentc0ad2a55bac2f974876432f7e8ec11cc9d1b05a6 (diff)
Fixed EXT-6423(normal) - Windows viewer spends a minute clearing cache when there is no cache
Problem description: The code that purges cache does not expect any folders there, error occurs when it tries to delete a file, which is actually a folder. To handle an error the code sleeps for 1 second and tries to delete the file 4 more times(sleeping for 1 second after each try). Fix info: Using LLFile::isDir to skip directories and only delete files. Reviewed by Vadim Savchuk - https://codereview.productengine.com/secondlife/r/239/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/llvfs/lldir.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index da4abde451..29b6f490c8 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -91,15 +91,16 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
S32 result;
while (getNextFileInDir(dirname, mask, filename, FALSE))
{
- if ((filename == ".") || (filename == ".."))
+ fullpath = dirname;
+ fullpath += getDirDelimiter();
+ fullpath += filename;
+
+ if(LLFile::isdir(fullpath))
{
// skipping directory traversal filenames
count++;
continue;
}
- fullpath = dirname;
- fullpath += getDirDelimiter();
- fullpath += filename;
S32 retry_count = 0;
while (retry_count < 5)