зеркало из https://github.com/mozilla/pjs.git
improve corrupt db detection and handling part of fix for 48466 r=mscott
This commit is contained in:
Родитель
c9d28389ff
Коммит
059a4f9dba
|
@ -93,7 +93,7 @@ NS_IMETHODIMP nsImapMailDatabase::Open(nsIFileSpec *aFolderName, PRBool create,
|
|||
|
||||
err = mailDB->OpenMDB((const char *) summarySpec, create);
|
||||
|
||||
if (NS_SUCCEEDED(err))
|
||||
if (err == NS_OK)
|
||||
{
|
||||
mailDB->GetDBFolderInfo(&folderInfo);
|
||||
if (folderInfo == NULL)
|
||||
|
@ -131,7 +131,9 @@ NS_IMETHODIMP nsImapMailDatabase::Open(nsIFileSpec *aFolderName, PRBool create,
|
|||
else if (err != NS_OK)
|
||||
{
|
||||
*pMessageDB = NULL;
|
||||
mailDB->Close(PR_FALSE);
|
||||
delete mailDB;
|
||||
summarySpec.Delete(PR_FALSE); // blow away the db if it's corrupt.
|
||||
mailDB = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -916,7 +916,8 @@ NS_IMETHODIMP nsMsgDatabase::OpenMDB(const char *dbName, PRBool create)
|
|||
}
|
||||
while (NS_SUCCEEDED(ret) && !outBroken && !outDone);
|
||||
// m_mdbEnv->ClearErrors(); // ### temporary...
|
||||
if (NS_SUCCEEDED(ret) && outDone)
|
||||
// only 0 is a non-error return.
|
||||
if (ret == 0 && outDone)
|
||||
{
|
||||
ret = myMDBFactory->ThumbToOpenStore(m_mdbEnv, thumb, &m_mdbStore);
|
||||
if (ret == NS_OK && m_mdbStore)
|
||||
|
|
Загрузка…
Ссылка в новой задаче