[fix][tmpfs]修正 getdents 中文件类型错误的判断变量

This commit is contained in:
angryproton
2026-07-20 10:18:14 +08:00
committed by Rbb666
parent b6cdae57d4
commit 560fa880ff
2 changed files with 4 additions and 4 deletions
@@ -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;
}
@@ -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;
}