diff --git a/components/dfs/dfs_v1/filesystems/tmpfs/dfs_tmpfs.c b/components/dfs/dfs_v1/filesystems/tmpfs/dfs_tmpfs.c index cb971ef30c3..223d1219991 100644 --- a/components/dfs/dfs_v1/filesystems/tmpfs/dfs_tmpfs.c +++ b/components/dfs/dfs_v1/filesystems/tmpfs/dfs_tmpfs.c @@ -607,11 +607,11 @@ int dfs_tmpfs_getdents(struct dfs_file *file, if (index >= (rt_size_t)file->pos) { d = dirp + count; - if (d_file->type == TMPFS_TYPE_FILE) + if (n_file->type == TMPFS_TYPE_FILE) { d->d_type = DT_REG; } - if (d_file->type == TMPFS_TYPE_DIR) + if (n_file->type == TMPFS_TYPE_DIR) { d->d_type = DT_DIR; } diff --git a/components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c b/components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c index 1dc1fd54f9e..996c01df782 100644 --- a/components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c +++ b/components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c @@ -525,11 +525,11 @@ static int dfs_tmpfs_getdents(struct dfs_file *file, if (index >= (rt_size_t)file->fpos) { d = dirp + count; - if (d_file->type == TMPFS_TYPE_FILE) + if (n_file->type == TMPFS_TYPE_FILE) { d->d_type = DT_REG; } - if (d_file->type == TMPFS_TYPE_DIR) + if (n_file->type == TMPFS_TYPE_DIR) { d->d_type = DT_DIR; }