Fix server crash when nvault is writting to journal file without write permission (bug 3231, r=Arkshine)
Former-commit-id: 6ad9e6bc8cf748bb06d5618cb21741d6e79b0110
This commit is contained in:
parent
bf395c8ac1
commit
15572e2d61
@ -129,7 +129,9 @@ bool Journal::Begin()
|
|||||||
|
|
||||||
bool Journal::End()
|
bool Journal::End()
|
||||||
{
|
{
|
||||||
fclose(m_fp);
|
if (m_fp)
|
||||||
|
fclose(m_fp);
|
||||||
|
|
||||||
m_Bw.SetFilePtr(NULL);
|
m_Bw.SetFilePtr(NULL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -266,8 +266,13 @@ bool NVault::Close()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
_SaveToFile();
|
_SaveToFile();
|
||||||
m_Journal->End();
|
|
||||||
m_Journal->Erase();
|
if (m_Journal)
|
||||||
|
{
|
||||||
|
m_Journal->End();
|
||||||
|
m_Journal->Erase();
|
||||||
|
}
|
||||||
|
|
||||||
m_Open = false;
|
m_Open = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user