Atomic PARAM.SFO writes

This commit is contained in:
Eladash 2021-02-21 21:55:07 +02:00 committed by Ivan
parent 0878db4e17
commit 932f31e37b
9 changed files with 108 additions and 11 deletions

View file

@ -190,8 +190,9 @@ void emu_settings::SaveSettings()
}
// Save config atomically
fs::file(config_name + ".tmp", fs::rewrite).write(out.c_str(), out.size());
fs::rename(config_name + ".tmp", config_name, true);
fs::pending_file temp(config_name);
temp.file.write(out.c_str(), out.size());
temp.commit();
// Check if the running config/title is the same as the edited config/title.
if (config_name == g_cfg.name || m_title_id == Emu.GetTitleID())