You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/10/19 13:20:42 UTC
[incubator-nuttx] 01/03: inode_stat: handle INODE_IS_PSEUDODIR case
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit aa67e0a0f4d8c89a6b46f991a3fffa19ebfe4417
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Oct 19 19:11:56 2022 +0900
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 06b9afff06..f4fb410c6d 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;
}