From 5479ab13075c6f2a4cb1fcbeb837e3fabb6097ae Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 21 Jan 2024 02:45:54 -0800 Subject: [PATCH] Vita: Use sceIoPwrite in VFileSce.sync --- src/platform/psp2/sce-vfs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/platform/psp2/sce-vfs.c b/src/platform/psp2/sce-vfs.c index 4e0fc5c02..a98e9943d 100644 --- a/src/platform/psp2/sce-vfs.c +++ b/src/platform/psp2/sce-vfs.c @@ -153,11 +153,10 @@ ssize_t _vfsceSize(struct VFile* vf) { bool _vfsceSync(struct VFile* vf, void* buffer, size_t size) { struct VFileSce* vfsce = (struct VFileSce*) vf; if (buffer && size) { - SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR); - sceIoLseek(vfsce->fd, 0, SEEK_SET); - int res = sceIoWrite(vfsce->fd, buffer, size); - sceIoLseek(vfsce->fd, cur, SEEK_SET); - return res == size; + int res = sceIoPwrite(vfsce->fd, buffer, size, 0); + if (res < 0 || (size_t) res != size) { + return false; + } } return sceIoSyncByFd(vfsce->fd, 0) >= 0; }