mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-02 16:53:17 +00:00
sceKernelOpen: fix params
Based on decompilation, the second parameter of _open should be flags. Additionally swaps the return and parameter types to align with our current standards.
This commit is contained in:
parent
e29e3f1985
commit
8b2ec07154
1 changed files with 5 additions and 7 deletions
|
@ -57,7 +57,7 @@ static std::map<std::string, FactoryDevice> available_device = {
|
|||
|
||||
namespace Libraries::Kernel {
|
||||
|
||||
int PS4_SYSV_ABI sceKernelOpen(const char* raw_path, int flags, u16 mode) {
|
||||
s32 PS4_SYSV_ABI sceKernelOpen(const char* raw_path, s32 flags, u16 mode) {
|
||||
LOG_INFO(Kernel_Fs, "path = {} flags = {:#x} mode = {}", raw_path, flags, mode);
|
||||
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
|
||||
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
|
||||
|
@ -161,9 +161,8 @@ int PS4_SYSV_ABI sceKernelOpen(const char* raw_path, int flags, u16 mode) {
|
|||
return handle;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI posix_open(const char* path, int flags, /* SceKernelMode*/ u16 mode) {
|
||||
LOG_INFO(Kernel_Fs, "posix open redirect to sceKernelOpen");
|
||||
int result = sceKernelOpen(path, flags, mode);
|
||||
s32 PS4_SYSV_ABI posix_open(const char* path, s32 flags, /* SceKernelMode*/ u16 mode) {
|
||||
s32 result = sceKernelOpen(path, flags, mode);
|
||||
// Posix calls different only for their return values
|
||||
if (result < 0) {
|
||||
ErrSceToPosix(result);
|
||||
|
@ -172,9 +171,8 @@ int PS4_SYSV_ABI posix_open(const char* path, int flags, /* SceKernelMode*/ u16
|
|||
return result;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI open(const char* filename, const char* mode) {
|
||||
LOG_INFO(Kernel_Fs, "open redirect to sceKernelOpen");
|
||||
int result = sceKernelOpen(filename, ORBIS_KERNEL_O_RDWR, 0);
|
||||
s32 PS4_SYSV_ABI open(const char* filename, s32 flags) {
|
||||
s32 result = sceKernelOpen(filename, flags, 0);
|
||||
if (result < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue