Browse Source

Patch procf (#95)

* debug color problem

Co-authored-by: longjin <longjin@RinGoTek.cn>
DaJiYuQia 2 years ago
parent
commit
d65ade9c59
1 changed files with 3 additions and 0 deletions
  1. 3 0
      kernel/src/filesystem/procfs/procfs.c

+ 3 - 0
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:;