summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-01-14 15:55:32 +0100
committerAnton Babushkin <anton.babushkin@me.com>2014-01-14 15:55:32 +0100
commit16c4e7f4e1987ef5da6be8a21a999e7dd7de1a6e (patch)
treec3be95dda0f1c2298f1bf0f671efb5a228342a94
parent5c25671c62c754be87b14ca340238f931ff87c2c (diff)
parent64fc22ccb08fe115ba1d74ee85b4fa0a99cdddc0 (diff)
downloadnuttx-16c4e7f4e1987ef5da6be8a21a999e7dd7de1a6e.tar.gz
nuttx-16c4e7f4e1987ef5da6be8a21a999e7dd7de1a6e.tar.bz2
nuttx-16c4e7f4e1987ef5da6be8a21a999e7dd7de1a6e.zip
Merge branch 'master' into env_expand
-rw-r--r--nuttx/fs/fat/fs_fat32.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c
index e7e32eee2..2fbb0cba2 100644
--- a/nuttx/fs/fat/fs_fat32.c
+++ b/nuttx/fs/fat/fs_fat32.c
@@ -621,7 +621,7 @@ fat_read_restart:
* cluster boundary
*/
- if (ff->ff_sectorsincluster < 1)
+ if (buflen != 0 && ff->ff_sectorsincluster < 1)
{
/* Find the next cluster in the FAT. */
@@ -896,7 +896,7 @@ fat_write_restart:
* cluster boundary
*/
- if (ff->ff_sectorsincluster < 1)
+ if (buflen != 0 && ff->ff_sectorsincluster < 1)
{
/* Extend the current cluster by one (unless lseek was used to
* move the file position back from the end of the file)
@@ -2119,7 +2119,11 @@ static int fat_mkdir(struct inode *mountpt, const char *relpath, mode_t mode)
DIR_PUTFSTCLUSTLO(direntry, dircluster);
parentcluster = dirinfo.dir.fd_startcluster;
- if (fs->fs_type != FSTYPE_FAT32 && parentcluster == fs->fs_rootbase)
+ /*
+ parent cluster for .. is set to 0 on all FAT types (including
+ FAT32). Tested on Windows8 and Linux
+ */
+ if (parentcluster == fs->fs_rootbase)
{
parentcluster = 0;
}