From d65ade9c5909076747bd00966a398fe27fbd290d Mon Sep 17 00:00:00 2001 From: DaJiYuQia <88259094+DaJiYuQia@users.noreply.github.com> Date: Sun, 27 Nov 2022 14:21:31 +0800 Subject: [PATCH] Patch procf (#95) * debug color problem Co-authored-by: longjin --- kernel/src/filesystem/procfs/procfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/src/filesystem/procfs/procfs.c b/kernel/src/filesystem/procfs/procfs.c index 61ea349c2..2a8d1bdf2 100644 --- a/kernel/src/filesystem/procfs/procfs.c +++ b/kernel/src/filesystem/procfs/procfs.c @@ -108,6 +108,7 @@ static long procfs_open(struct vfs_index_node_t *inode, struct vfs_file_t *file_ { return 0; } + struct procfs_inode_info_t *finode = inode->private_inode_info; if (finode == NULL) { @@ -285,6 +286,8 @@ static long procfs_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldi uint32_t dentry_type; if (target_dent->dir_inode->attribute & VFS_IF_DIR) dentry_type = VFS_IF_DIR; + else + dentry_type = VFS_IF_FILE; return filler(dirent, file_ptr->position - 1, name, target_dent->name_length, dentry_type, file_ptr->position - 1); failed:;