diff options
| author | bernard.xiong <[email protected]> | 2010-10-22 07:26:26 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-10-22 07:26:26 +0000 |
| commit | bd6d16ecdef9ed7a7e33e12dceb189d500b3e379 (patch) | |
| tree | d5b137ce70c6b6d46ca232e84899ac99bf0325f3 /components/dfs/src | |
| parent | af2019888f9e9ace79a569c39892648849655e52 (diff) | |
fix DFS elm struct mismatch issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1027 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs/src')
| -rw-r--r-- | components/dfs/src/dfs_file.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index c326052090..05b082e4ae 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -460,16 +460,21 @@ void ls(const char* pathname) rt_snprintf(fullpath, DFS_PATH_MAX + 1, "%s%c%s", pathname, '/', dirent.d_name);
else
rt_snprintf(fullpath, DFS_PATH_MAX + 1, "%s%s", pathname, dirent.d_name);
-
- dfs_file_stat(fullpath, &stat);
- if ( stat.st_mode & DFS_S_IFDIR )
+
+ if (dfs_file_stat(fullpath, &stat) == 0)
{
- rt_kprintf("%s\t\t<DIR>\n", dirent.d_name);
+ if ( stat.st_mode & DFS_S_IFDIR )
+ {
+ rt_kprintf("%s\t\t<DIR>\n", dirent.d_name);
+ }
+ else
+ {
+ rt_kprintf("%s\t\t%lu\n", dirent.d_name, stat.st_size);
+ }
}
else
- {
- rt_kprintf("%s\t\t%lu\n", dirent.d_name, stat.st_size);
- }
+ rt_kprintf("BAD file: %s\n", dirent.d_name);
+
}
}while(length > 0);
|
