Add some code to copy bad history files to history_BAD-N.dat for debugging bug 280342.

git-svn-id: svn://10.0.0.236/trunk@168840 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
smfr%smfr.org 2005-02-05 06:53:37 +00:00
parent fb2640c337
commit f5aca049c8

View File

@ -1668,7 +1668,18 @@ nsSimpleGlobalHistory::OpenDB()
#endif
// we couldn't open the file, so it's either corrupt or doesn't exist.
// attempt to delete the file, but ignore the error
#ifdef DEBUG_HISTORY
nsCOMPtr<nsIFile> fileCopy;
historyFile->Clone(getter_AddRefs(fileCopy));
fileCopy->SetLeafName(NS_LITERAL_STRING("history_BAD.dat"));
fileCopy->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
nsString uniqueFileName;
fileCopy->GetLeafName(uniqueFileName);
historyFile->MoveTo(nsnull, uniqueFileName);
#else
historyFile->Remove(PR_FALSE);
#endif
rv = OpenNewFile(gMdbFactory, filePath.get());
}