Fix atomicity of savedata/trophy data writes

This commit is contained in:
Eladash 2021-02-22 14:36:35 +02:00 committed by Ivan
parent 932f31e37b
commit d4af8dd89a
3 changed files with 10 additions and 5 deletions

View file

@ -1911,7 +1911,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
if (auto file = pair.second.release())
{
auto fvec = static_cast<fs::container_stream<std::vector<uchar>>&>(*file);
fs::file(new_path + vfs::escape(pair.first), fs::rewrite).write(fvec.obj);
ensure(fs::write_file<true>(new_path + vfs::escape(pair.first), fs::rewrite, fvec.obj));
}
}