mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
Atomically overwrite config.yml
Protection against data corruption.
This commit is contained in:
parent
bd6fdf3f2d
commit
e485c9c79c
2 changed files with 6 additions and 12 deletions
|
@ -1202,8 +1202,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
|
|||
games[m_title_id] = bdvd_dir;
|
||||
YAML::Emitter out;
|
||||
out << games;
|
||||
fs::file(fs::get_config_dir() + "/_tmp_games.yml", fs::rewrite).write(out.c_str(), out.size());
|
||||
fs::rename(fs::get_config_dir() + "/_tmp_games.yml", fs::get_config_dir() + "/games.yml", true);
|
||||
fs::file(fs::get_config_dir() + "/games.yml.tmp", fs::rewrite).write(out.c_str(), out.size());
|
||||
fs::rename(fs::get_config_dir() + "/games.yml.tmp", fs::get_config_dir() + "/games.yml", true);
|
||||
}
|
||||
else if (m_cat == "1P" && from_hdd0_game)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue