PSP2: Sync files per descriptor
Jeffrey Pfau jeffrey@endrift.com
Sat, 13 Aug 2016 19:44:26 -0700
2 files changed,
4 insertions(+),
3 deletions(-)
M
src/platform/psp2/sce-vfs.c
→
src/platform/psp2/sce-vfs.c
@@ -76,7 +76,7 @@ }
bool _vfsceClose(struct VFile* vf) { struct VFileSce* vfsce = (struct VFileSce*) vf; - + sceIoSyncByFd(vfsce->fd); return sceIoClose(vfsce->fd) >= 0; }@@ -112,6 +112,7 @@ struct VFileSce* vfsce = (struct VFileSce*) vf;
SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR); sceIoWrite(vfsce->fd, memory, size); sceIoLseek(vfsce->fd, cur, SEEK_SET); + sceIoSyncByFd(vfsce->fd); mappedMemoryFree(memory, size); }@@ -136,8 +137,7 @@ sceIoLseek(vfsce->fd, 0, SEEK_SET);
sceIoWrite(vfsce->fd, buffer, size); sceIoLseek(vfsce->fd, cur, SEEK_SET); } - // TODO: Get the right device - return sceIoSync("ux0:", 0) >= 0; + return sceIoSyncByFd(vfsce->fd) >= 0; } struct VDir* VDirOpen(const char* path) {