Remove hacky read-only behavior in posix_stat

Bloodborne apparently uses the mode parameter here when querying it's audio files, and the mode we returned led to it disabling audio entirely.
This commit is contained in:
Stephen Miller 2025-04-30 12:27:46 -05:00
parent ea235046b4
commit 9532c07c34

View File

@ -571,8 +571,7 @@ s32 PS4_SYSV_ABI sceKernelRmdir(const char* path) {
s32 PS4_SYSV_ABI posix_stat(const char* path, OrbisKernelStat* sb) { s32 PS4_SYSV_ABI posix_stat(const char* path, OrbisKernelStat* sb) {
LOG_INFO(Kernel_Fs, "(PARTIAL) path = {}", path); LOG_INFO(Kernel_Fs, "(PARTIAL) path = {}", path);
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance(); auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
bool ro = false; const auto path_name = mnt->GetHostPath(path);
const auto path_name = mnt->GetHostPath(path, &ro);
std::memset(sb, 0, sizeof(OrbisKernelStat)); std::memset(sb, 0, sizeof(OrbisKernelStat));
const bool is_dir = std::filesystem::is_directory(path_name); const bool is_dir = std::filesystem::is_directory(path_name);
const bool is_file = std::filesystem::is_regular_file(path_name); const bool is_file = std::filesystem::is_regular_file(path_name);
@ -593,9 +592,6 @@ s32 PS4_SYSV_ABI posix_stat(const char* path, OrbisKernelStat* sb) {
sb->st_blocks = (sb->st_size + 511) / 512; sb->st_blocks = (sb->st_size + 511) / 512;
// TODO incomplete // TODO incomplete
} }
if (ro) {
sb->st_mode &= ~0000555u;
}
return ORBIS_OK; return ORBIS_OK;
} }