Close persistent file before attempting to rename.

Windows requires the file be closed in order to rename it.
This commit is contained in:
Peter Johnson
2015-08-24 20:38:33 -07:00
parent b8a99690b6
commit 822dc45834

View File

@@ -803,6 +803,7 @@ const char* Storage::SavePersistent(StringRef filename, bool periodic) const {
err = "error saving file";
goto done;
}
os.close();
// Safely move to real file. We ignore any failures related to the backup.
std::remove(bak.c_str());