From a7699b0bdbc81b1bc68bfafb9b5ded0ae6a641bc Mon Sep 17 00:00:00 2001 From: "yanxiaoyong.yxy" Date: Fri, 6 May 2022 17:55:35 +0800 Subject: [PATCH] IssueID:1570: vfs supports rootdir. [Detail] none [Verified Cases] Build Pass: Test Pass: --- components/vfs/vfs_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/vfs/vfs_inode.c b/components/vfs/vfs_inode.c index 817010eebc..5cab03f3bc 100644 --- a/components/vfs/vfs_inode.c +++ b/components/vfs/vfs_inode.c @@ -157,7 +157,7 @@ vfs_inode_t *vfs_inode_open(const char *path) } if (INODE_IS_TYPE(node, VFS_TYPE_FS_DEV)) { - if (strncmp(node->i_name, path, strlen(node->i_name)) == 0) { + if ((strncmp(node->i_name, path, strlen(node->i_name)) == 0) && (strncmp("/dev", path, strlen("/dev")) != 0)) { #ifdef VFS_CONFIG_ROOTFS fs_match = true; #endif -- GitLab