summaryrefslogtreecommitdiffstats
path: root/firmware/common/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r--firmware/common/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 83c8e045fa..4443b55bca 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -573,6 +573,13 @@ int lseek(int fd, int offset, int whence)
return rc * 10 - 6;
}
file->cacheoffset = sectoroffset;
+
+ /* seek back to current sector */
+ rc = fat_seek(&(file->fatfile), newsector);
+ if ( rc < 0 ) {
+ errno = EIO;
+ return rc * 10 - 7;
+ }
}
else
file->cacheoffset = -1;