Vita: Use sceIoPwrite in VFileSce.sync
This commit is contained in:
parent
4e87dc61ee
commit
5479ab1307
@ -153,11 +153,10 @@ ssize_t _vfsceSize(struct VFile* vf) {
|
|||||||
bool _vfsceSync(struct VFile* vf, void* buffer, size_t size) {
|
bool _vfsceSync(struct VFile* vf, void* buffer, size_t size) {
|
||||||
struct VFileSce* vfsce = (struct VFileSce*) vf;
|
struct VFileSce* vfsce = (struct VFileSce*) vf;
|
||||||
if (buffer && size) {
|
if (buffer && size) {
|
||||||
SceOff cur = sceIoLseek(vfsce->fd, 0, SEEK_CUR);
|
int res = sceIoPwrite(vfsce->fd, buffer, size, 0);
|
||||||
sceIoLseek(vfsce->fd, 0, SEEK_SET);
|
if (res < 0 || (size_t) res != size) {
|
||||||
int res = sceIoWrite(vfsce->fd, buffer, size);
|
return false;
|
||||||
sceIoLseek(vfsce->fd, cur, SEEK_SET);
|
}
|
||||||
return res == size;
|
|
||||||
}
|
}
|
||||||
return sceIoSyncByFd(vfsce->fd, 0) >= 0;
|
return sceIoSyncByFd(vfsce->fd, 0) >= 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user