From 6fe72758dea496ecb36748ae0269c958c64c105f Mon Sep 17 00:00:00 2001 From: mailwl Date: Fri, 7 Feb 2025 21:50:30 +0300 Subject: [PATCH] be sure, if seek really return error --- src/core/libraries/kernel/file_system.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 600164ef7..a7adb169f 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -317,15 +317,14 @@ s64 PS4_SYSV_ABI sceKernelLseek(int d, s64 offset, int whence) { } s64 PS4_SYSV_ABI posix_lseek(int d, s64 offset, int whence) { - // Workaround for XNA AudioEngine - if (whence == SEEK_SET && (s32)offset == -1) { - SetPosixErrno(EINVAL); - return offset; - } - s64 result = sceKernelLseek(d, offset, whence); if (result < 0) { LOG_ERROR(Kernel_Pthread, "posix_lseek: error = {}", result); + // Workaround for XNA AudioEngine + if (whence == SEEK_SET && (s32)offset == -1) { + SetPosixErrno(EINVAL); + return offset; + } ErrSceToPosix(result); return -1; }