Browse Source

第415行
if (fno.fattrib & AM_DIR) d->d_type &= DFS_DT_DIR;
else d->d_type &= DFS_DT_REG;
改为:
if (fno.fattrib & AM_DIR) d->d_type = DFS_DT_DIR;
else d->d_type = DFS_DT_REG;

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@997 bbd45198-f89e-11dd-88c7-29a3b14d5316

jiaojinxing1987@gmail.com 14 years ago
parent
commit
47c5101124
1 changed files with 2 additions and 2 deletions
  1. 2 2
      components/dfs/filesystems/elmfat/dfs_elm.c

+ 2 - 2
components/dfs/filesystems/elmfat/dfs_elm.c

@@ -412,8 +412,8 @@ int dfs_elm_getdents(struct dfs_fd* file, struct _dirent* dirp, rt_uint32_t coun
 #endif
 
 		d->d_type = DFS_DT_UNKNOWN;
-		if (fno.fattrib & AM_DIR) d->d_type &= DFS_DT_DIR;
-		else d->d_type &= DFS_DT_REG;
+		if (fno.fattrib & AM_DIR) d->d_type = DFS_DT_DIR;
+		else d->d_type = DFS_DT_REG;
 
 		d->d_namlen = rt_strlen(fn);
 		d->d_reclen = (rt_uint16_t)sizeof(struct _dirent);