summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-10-31 20:41:36 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-10-31 20:41:36 +0000
commit675d258575575afd2439362f44c2a73882a9890e (patch)
tree3bd29aed0a5189bc555632bfcd18b8789c6c0c63 /firmware/common
parentf9b5fdcd4d0a8095d6bc5bb91473de56ab6381c6 (diff)
downloadrockbox-675d258575575afd2439362f44c2a73882a9890e.tar.gz
rockbox-675d258575575afd2439362f44c2a73882a9890e.zip
Fixed lseek().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2796 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common')
-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 )