From aa67e0a0f4d8c89a6b46f991a3fffa19ebfe4417 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 19 Oct 2022 19:11:56 +0900 Subject: [PATCH] inode_stat: handle INODE_IS_PSEUDODIR case If you open() a directory and fstat() it, you come here. This commit fixes the file type in that case. --- fs/vfs/fs_stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/vfs/fs_stat.c b/fs/vfs/fs_stat.c index 06b9afff069..f4fb410c6da 100644 --- a/fs/vfs/fs_stat.c +++ b/fs/vfs/fs_stat.c @@ -381,9 +381,9 @@ int inode_stat(FAR struct inode *inode, FAR struct stat *buf, int resolve) /* Determine the type of the inode */ - /* Check for a mountpoint */ + /* Check for a mountpoint and a pseudo dir */ - if (INODE_IS_MOUNTPT(inode)) + if (INODE_IS_MOUNTPT(inode) || INODE_IS_PSEUDODIR(inode)) { buf->st_mode |= S_IFDIR; }