Remove Bloodborne hack

Games should be able to unlink files that aren't opened file descriptors. As far as I've tested, this doesn't break Bloodborne.
This commit is contained in:
Stephen Miller 2025-03-25 18:21:29 -05:00
parent f9558ec1b6
commit 4a4536724f

View File

@ -948,12 +948,13 @@ s32 PS4_SYSV_ABI posix_unlink(const char* path) {
auto* file = h->GetFile(host_path);
if (file == nullptr) {
// Cannot unlink an unopened file
return ORBIS_OK;
// File to unlink hasn't been opened, manually open and unlink it.
Common::FS::IOFile file(host_path, Common::FS::FileAccessMode::ReadWrite);
file.Unlink();
} else {
file->f.Unlink();
}
file->f.Unlink();
LOG_INFO(Kernel_Fs, "Unlinked {}", path);
return ORBIS_OK;
}