summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-10-22 15:06:08 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-10-22 15:06:08 +0000
commit46ddacf533b2b154373f0ac98c85b4ac172ccfa6 (patch)
treedb40164976c9993e1b12a60bb63320a0aa382390 /firmware/common
parenta901c3a433125a939bef9caf6a8219f97f395fc7 (diff)
downloadrockbox-46ddacf533b2b154373f0ac98c85b4ac172ccfa6.zip
rockbox-46ddacf533b2b154373f0ac98c85b4ac172ccfa6.tar.gz
rockbox-46ddacf533b2b154373f0ac98c85b4ac172ccfa6.tar.bz2
rockbox-46ddacf533b2b154373f0ac98c85b4ac172ccfa6.tar.xz
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
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/file.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 3e402bd..0cde938 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -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;