VFS: Actually fflush sync when doing writeback

This commit is contained in:
Vicki Pfau 2023-04-13 02:29:27 -07:00
parent edc0828437
commit b876f13cb2
1 changed files with 3 additions and 1 deletions

View File

@ -151,7 +151,9 @@ static bool _vffSync(struct VFile* vf, void* buffer, size_t size) {
fseek(vff->file, 0, SEEK_SET);
size_t res = fwrite(buffer, size, 1, vff->file);
fseek(vff->file, pos, SEEK_SET);
return res == 1;
if (res != 1) {
return false;
}
}
return fflush(vff->file) == 0;
}