aboutsummaryrefslogtreecommitdiff
path: root/nuttx/fs/fat
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-02-07 00:29:06 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-02-07 00:29:06 +0000
commit1b3d8f3148527a6d13c7c8da0202c8dd55546cf1 (patch)
tree8e7211f824fba909e19dc46f1c40f8ae238ab212 /nuttx/fs/fat
parent3d264a65026b51036f21dcf69fd1ca576f128b80 (diff)
downloadpx4-firmware-1b3d8f3148527a6d13c7c8da0202c8dd55546cf1.tar.gz
px4-firmware-1b3d8f3148527a6d13c7c8da0202c8dd55546cf1.tar.bz2
px4-firmware-1b3d8f3148527a6d13c7c8da0202c8dd55546cf1.zip
Fix a bug in the FAT statfs() implementation
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4375 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/fs/fat')
-rw-r--r--nuttx/fs/fat/fs_fat32.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c
index 0ec1d78cf..909d5a2dc 100644
--- a/nuttx/fs/fat/fs_fat32.c
+++ b/nuttx/fs/fat/fs_fat32.c
@@ -1,8 +1,8 @@
/****************************************************************************
* fs/fat/fs_fat32.c
*
- * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
* Microsoft FAT documentation
@@ -1706,13 +1706,13 @@ static int fat_statfs(struct inode *mountpt, struct statfs *buf)
/* Everything else follows in units of clusters */
- buf->f_blocks = fs->fs_nclusters; /* Total data blocks in the file system */
- buf->f_bfree = fat_nfreeclusters(fs, &buf->f_bfree); /* Free blocks in the file system */
- buf->f_bavail = buf->f_bfree; /* Free blocks avail to non-superuser */
- buf->f_namelen = (8+1+3); /* Maximum length of filenames */
-
- fat_semgive(fs);
- return OK;
+ ret = fat_nfreeclusters(fs, &buf->f_bfree); /* Free blocks in the file system */
+ if (ret >= 0)
+ {
+ buf->f_blocks = fs->fs_nclusters; /* Total data blocks in the file system */
+ buf->f_bavail = buf->f_bfree; /* Free blocks avail to non-superuser */
+ buf->f_namelen = (8+1+3); /* Maximum length of filenames */
+ }
errout_with_semaphore:
fat_semgive(fs);