diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-10-22 15:06:08 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-10-22 15:06:08 +0000 |
commit | 46ddacf533b2b154373f0ac98c85b4ac172ccfa6 (patch) | |
tree | db40164976c9993e1b12a60bb63320a0aa382390 /firmware/common | |
parent | a901c3a433125a939bef9caf6a8219f97f395fc7 (diff) | |
download | rockbox-46ddacf533b2b154373f0ac98c85b4ac172ccfa6.tar.gz rockbox-46ddacf533b2b154373f0ac98c85b4ac172ccfa6.zip |
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.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index 3e402bde2b..0cde938a70 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c | |||
@@ -178,7 +178,7 @@ int close(int fd) | |||
178 | } | 178 | } |
179 | 179 | ||
180 | /* tie up all loose ends */ | 180 | /* tie up all loose ends */ |
181 | fat_closewrite(&(openfiles[fd].fatfile), openfiles[fd].size); | 181 | fat_closewrite(&(openfiles[fd].fatfile), openfiles[fd].fileoffset); |
182 | } | 182 | } |
183 | openfiles[fd].busy = false; | 183 | openfiles[fd].busy = false; |
184 | return rc; | 184 | return rc; |
@@ -239,8 +239,6 @@ static int readwrite(int fd, void* buf, int count, bool write) | |||
239 | 239 | ||
240 | nread = headbytes; | 240 | nread = headbytes; |
241 | count -= headbytes; | 241 | count -= headbytes; |
242 | |||
243 | LDEBUGF("readwrite incache: offs=%d\n",openfiles[fd].cacheoffset); | ||
244 | } | 242 | } |
245 | 243 | ||
246 | /* read whole sectors right into the supplied buffer */ | 244 | /* read whole sectors right into the supplied buffer */ |
@@ -316,6 +314,13 @@ int lseek(int fd, int offset, int whence) | |||
316 | return -1; | 314 | return -1; |
317 | } | 315 | } |
318 | 316 | ||
317 | if ( openfiles[fd].write ) { | ||
318 | DEBUGF("lseek() is not supported when writing\n"); | ||
319 | errno = EROFS; | ||
320 | return -2; | ||
321 | } | ||
322 | |||
323 | |||
319 | switch ( whence ) { | 324 | switch ( whence ) { |
320 | case SEEK_SET: | 325 | case SEEK_SET: |
321 | pos = offset; | 326 | pos = offset; |