mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
Make gamedata installation atomic as real PS3
This commit is contained in:
parent
a9b0d25c01
commit
d7b4753007
6 changed files with 123 additions and 11 deletions
|
|
@ -749,7 +749,21 @@ bool vfs::host::rename(const std::string& from, const std::string& to, const lv2
|
|||
if (check_path(fs::escape_path(file.real_path)))
|
||||
{
|
||||
ensure(file.mp == mp);
|
||||
|
||||
if (!file.file)
|
||||
{
|
||||
file.restore_data.seek_pos = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
file.restore_data.seek_pos = file.file.pos();
|
||||
|
||||
if (std::memcmp(file.name.data(), "/dev_hdd1/", 10) != 0
|
||||
&& !(file.mp->flags & lv2_mp_flag::read_only) && file.flags & CELL_FS_O_ACCMODE)
|
||||
{
|
||||
file.file.sync(); // For cellGameContentPermit atomicity
|
||||
}
|
||||
|
||||
file.file.close(); // Actually close it!
|
||||
}
|
||||
});
|
||||
|
|
@ -779,6 +793,11 @@ bool vfs::host::rename(const std::string& from, const std::string& to, const lv2
|
|||
|
||||
if (check_path(escaped_real))
|
||||
{
|
||||
if (file.restore_data.seek_pos == umax)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Update internal path
|
||||
if (res)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue