summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldir.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2011-01-28 18:05:10 -0800
committerDon Kjer <don@lindenlab.com>2011-01-28 18:05:10 -0800
commitf2a1f0df3a3c8ce18179ea06992f5e5d07f2f773 (patch)
treecd571814ec2e9d11ef05f8107e068ca6702df2a6 /indra/llvfs/lldir.cpp
parent4a083db6c52d2cc5c1cd1f908270f5952ace6505 (diff)
parentb4b3f78c455a614d7738c29cdc6383e857d6028d (diff)
Merge from viewer-development
Diffstat (limited to 'indra/llvfs/lldir.cpp')
-rw-r--r--indra/llvfs/lldir.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index ab7d15dfef..cb898e385f 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -40,8 +40,6 @@
#include "lltimer.h" // ms_sleep()
#include "lluuid.h"
-#include "lldiriterator.h"
-
#if LL_WINDOWS
#include "lldir_win32.h"
LLDir_Win32 gDirUtil;
@@ -85,9 +83,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
std::string filename;
std::string fullpath;
S32 result;
-
- LLDirIterator iter(dirname, mask);
- while (iter.next(filename))
+ while (getNextFileInDir(dirname, mask, filename))
{
fullpath = dirname;
fullpath += getDirDelimiter();
@@ -105,10 +101,18 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
{
if (0 != LLFile::remove(fullpath))
{
+ retry_count++;
result = errno;
llwarns << "Problem removing " << fullpath << " - errorcode: "
<< result << " attempt " << retry_count << llendl;
- ms_sleep(1000);
+
+ if(retry_count >= 5)
+ {
+ llwarns << "Failed to remove " << fullpath << llendl ;
+ return count ;
+ }
+
+ ms_sleep(100);
}
else
{
@@ -117,8 +121,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
llwarns << "Successfully removed " << fullpath << llendl;
}
break;
- }
- retry_count++;
+ }
}
count++;
}