diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 24bd725067..b7803c33fb 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -600,32 +600,18 @@ static int HandleSeparateUpdateDents(int fd, char* buf, int nbytes, s64* basep) int PS4_SYSV_ABI sceKernelGetdents(int fd, char* buf, int nbytes) { int a = GetDents(fd, buf, nbytes, nullptr); - int b = HandleSeparateUpdateDents(fd, buf, nbytes, nullptr); - if (a == ORBIS_OK && b == ORBIS_OK) { - return ORBIS_OK; - } - if (a < 0) { - return a; - } - if (b < 0) { - return b; + if (a == ORBIS_OK) { + return HandleSeparateUpdateDents(fd, buf, nbytes, nullptr); } - return a + b; + return a; } int PS4_SYSV_ABI sceKernelGetdirentries(int fd, char* buf, int nbytes, s64* basep) { int a = GetDents(fd, buf, nbytes, basep); - int b = HandleSeparateUpdateDents(fd, buf, nbytes, basep); - if (a == ORBIS_OK && b == ORBIS_OK) { - return ORBIS_OK; - } - if (a < 0) { - return a; - } - if (b < 0) { - return b; + if (a == ORBIS_OK) { + return HandleSeparateUpdateDents(fd, buf, nbytes, basep); } - return a + b; + return a; } s64 PS4_SYSV_ABI sceKernelPwrite(int d, void* buf, size_t nbytes, s64 offset) {