AP_Filesystem: fixed flushing with posix compat layer

this ensures the directory entry in the FAT is updated on fflush()

Fixes #14617
This commit is contained in:
Andrew Tridgell 2020-11-11 11:53:21 +11:00
parent bd6b28e5d9
commit 0db8745320
1 changed files with 4 additions and 1 deletions

View File

@ -107,7 +107,10 @@ int apfs_fprintf(APFS_FILE *stream, const char *fmt, ...)
int apfs_fflush(APFS_FILE *stream) int apfs_fflush(APFS_FILE *stream)
{ {
CHECK_STREAM(stream, EOF); CHECK_STREAM(stream, EOF);
return 0; if (AP::FS().fsync(stream->fd) == 0) {
return 0;
}
return EOF;
} }
size_t apfs_fread(void *ptr, size_t size, size_t nmemb, APFS_FILE *stream) size_t apfs_fread(void *ptr, size_t size, size_t nmemb, APFS_FILE *stream)