summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 1d78dcb456..644019effc 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -358,13 +358,11 @@ static int readwrite(int fd, void* buf, int count, bool write)
358 if (write) { 358 if (write) {
359 memcpy( file->cache + offs, buf, headbytes ); 359 memcpy( file->cache + offs, buf, headbytes );
360 if (offs+headbytes == SECTOR_SIZE) { 360 if (offs+headbytes == SECTOR_SIZE) {
361 int rc = fat_readwrite(&(file->fatfile), 1, 361 int rc = flush_cache(fd);
362 file->cache, true );
363 if ( rc < 0 ) { 362 if ( rc < 0 ) {
364 errno = EIO; 363 errno = EIO;
365 return -2; 364 return -2;
366 } 365 }
367 file->dirty = false;
368 file->cacheoffset = -1; 366 file->cacheoffset = -1;
369 } 367 }
370 else 368 else