1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Fix vfs::host::remove_all

Separate WIN32-specific logic.
Don't call fs::remove_all on WIN32 path.
This commit is contained in:
Nekotekina 2019-11-07 21:10:59 +03:00
parent 4ff6acf6ba
commit 24fdd24808

View File

@ -609,6 +609,7 @@ bool vfs::host::unlink(const std::string& path, const std::string& dev_root)
bool vfs::host::remove_all(const std::string& path, const std::string& dev_root, bool remove_root) bool vfs::host::remove_all(const std::string& path, const std::string& dev_root, bool remove_root)
{ {
#ifdef _WIN32
if (remove_root) if (remove_root)
{ {
// Rename to special dummy folder which will be ignored by VFS (but opened file handles can still read or write it) // Rename to special dummy folder which will be ignored by VFS (but opened file handles can still read or write it)
@ -619,7 +620,12 @@ bool vfs::host::remove_all(const std::string& path, const std::string& dev_root,
return false; return false;
} }
if (!fs::remove_all(dummy)) if (!vfs::host::remove_all(dummy, dev_root, false))
{
return false;
}
if (!fs::remove_dir(dummy))
{ {
return false; return false;
} }
@ -658,4 +664,7 @@ bool vfs::host::remove_all(const std::string& path, const std::string& dev_root,
} }
return true; return true;
#else
return fs::remove_all(path, remove_root);
#endif
} }