summaryrefslogtreecommitdiff
path: root/indra/newview/lllogchat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lllogchat.cpp')
-rw-r--r--indra/newview/lllogchat.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 6562cfe1bb..448100c5d6 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -517,6 +517,22 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,
backupFileCount = 0;
newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos);
+ //The target directory contains that file already, so lets store it
+ if(LLFile::isfile(newFullPath))
+ {
+ backupFileName = newFullPath + ".backup";
+
+ //If needed store backup file as .backup1 etc.
+ while(LLFile::isfile(backupFileName))
+ {
+ ++backupFileCount;
+ backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount);
+ }
+
+ //Rename the file to its backup name so it is not overwritten
+ LLFile::rename(newFullPath, backupFileName);
+ }
+
S32 retry_count = 0;
while (retry_count < 5)
{
@@ -528,22 +544,6 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,
LL_WARNS("LLLogChat::moveTranscripts") << "Problem renaming " << fullpath << " - errorcode: "
<< result << " attempt " << retry_count << LL_ENDL;
- //The target directory contains that file already, so lets store it
- if(LLFile::isfile(newFullPath))
- {
- backupFileName = newFullPath + ".backup";
-
- //If needed store backup file as .backup1 etc.
- while(LLFile::isfile(backupFileName))
- {
- ++backupFileCount;
- backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount);
- }
-
- //Rename the file to its backup name so it is not overwritten
- LLFile::rename(newFullPath, backupFileName);
- }
-
ms_sleep(100);
}
else