forked from len0rd/rockbox
Fat32 write updates: Nixed some bugs. Basic file creation now works. Todo: Long filenames and extensive test cases.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2742 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a901c3a433
commit
46ddacf533
5 changed files with 121 additions and 106 deletions
|
|
@ -178,7 +178,7 @@ int close(int fd)
|
|||
}
|
||||
|
||||
/* tie up all loose ends */
|
||||
fat_closewrite(&(openfiles[fd].fatfile), openfiles[fd].size);
|
||||
fat_closewrite(&(openfiles[fd].fatfile), openfiles[fd].fileoffset);
|
||||
}
|
||||
openfiles[fd].busy = false;
|
||||
return rc;
|
||||
|
|
@ -239,8 +239,6 @@ static int readwrite(int fd, void* buf, int count, bool write)
|
|||
|
||||
nread = headbytes;
|
||||
count -= headbytes;
|
||||
|
||||
LDEBUGF("readwrite incache: offs=%d\n",openfiles[fd].cacheoffset);
|
||||
}
|
||||
|
||||
/* read whole sectors right into the supplied buffer */
|
||||
|
|
@ -316,6 +314,13 @@ int lseek(int fd, int offset, int whence)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if ( openfiles[fd].write ) {
|
||||
DEBUGF("lseek() is not supported when writing\n");
|
||||
errno = EROFS;
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
switch ( whence ) {
|
||||
case SEEK_SET:
|
||||
pos = offset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue