summaryrefslogtreecommitdiff
path: root/firmware/common/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r--firmware/common/file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 3e730c2880..ae5560407b 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -363,13 +363,15 @@ int lseek(int fd, int offset, int whence)
363 return -4; 363 return -4;
364 } 364 }
365 } 365 }
366 rc = fat_readwrite(&(openfiles[fd].fatfile), 1, 366 if ( sectoroffset ) {
367 &(openfiles[fd].cache),false); 367 rc = fat_readwrite(&(openfiles[fd].fatfile), 1,
368 if ( rc < 0 ) { 368 &(openfiles[fd].cache),false);
369 errno = EIO; 369 if ( rc < 0 ) {
370 return -5; 370 errno = EIO;
371 return -5;
372 }
373 openfiles[fd].cacheoffset = sectoroffset;
371 } 374 }
372 openfiles[fd].cacheoffset = sectoroffset;
373 } 375 }
374 else 376 else
375 if ( openfiles[fd].cacheoffset != -1 ) 377 if ( openfiles[fd].cacheoffset != -1 )