Implement lv2_mp_flag::cache

Identify /dev_hdd1 without unsafe path comparison.
This commit is contained in:
Nekotekina 2021-03-16 19:37:00 +03:00
parent f801dc6558
commit 8fcebebae3
4 changed files with 5 additions and 6 deletions

View file

@ -758,8 +758,7 @@ bool vfs::host::rename(const std::string& from, const std::string& to, const lv2
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)
if (!(file.mp->flags & (lv2_mp_flag::read_only + lv2_mp_flag::cache)) && file.flags & CELL_FS_O_ACCMODE)
{
file.file.sync(); // For cellGameContentPermit atomicity
}