mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 14:31:24 +12:00
sys_fs: Fix sys_fs_disk_free
This commit is contained in:
parent
762ceaf87e
commit
a21790b992
1 changed files with 10 additions and 11 deletions
|
@ -1887,20 +1887,19 @@ error_code sys_fs_disk_free(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u64> t
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::device_stat info;
|
// avail_free is the only value used by cellFsGetFreeSize
|
||||||
if (!fs::statfs(local_path, info))
|
if (mp == &g_mp_sys_dev_hdd1)
|
||||||
{
|
{
|
||||||
switch (auto error = fs::g_tls_error)
|
*avail_free = (1u << 31) - mp->sector_size; // 2GB (TODO: Should be the total size)
|
||||||
{
|
}
|
||||||
case fs::error::noent: return {CELL_ENOENT, path};
|
else //if (mp == &g_mp_sys_dev_hdd0)
|
||||||
default: sys_fs.error("sys_fs_disk_free(): unknown error %s", error);
|
{
|
||||||
}
|
*avail_free = (40ull * 1024 * 1024 * 1024 - mp->sector_size); // Read explanation in cellHddGameCheck
|
||||||
|
|
||||||
return {CELL_EIO, path}; // ???
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*total_free = info.total_free;
|
// HACK: Hopefully nothing uses this value or once at max because its hacked here:
|
||||||
*avail_free = info.avail_free; //Only value used by cellFsGetFreeSize
|
// The total size can change based on the size of the directory
|
||||||
|
*total_free = *avail_free + fs::get_dir_size(local_path, mp->sector_size);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue