Merge branch 'master' into devfs

This commit is contained in:
fslongjin 2022-09-07 23:33:11 +08:00
commit d3a1754d4a

View File

@ -85,8 +85,9 @@ static long devfs_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir
++file_ptr->position; ++file_ptr->position;
// 获取目标dentry由于是子目录项因此是child_node_list // 获取目标dentry由于是子目录项因此是child_node_list
struct vfs_dir_entry_t *target_dent = container_of(list, struct vfs_dir_entry_t, child_node_list); struct vfs_dir_entry_t *target_dent = container_of(list, struct vfs_dir_entry_t, child_node_list);
// kdebug("target name=%s, namelen=%d", target_dent->name, target_dent->name_length); // kdebug("target name=%s, namelen=%d", target_dent->name, target_dent->name_length);
char *name = (char *)kzalloc(target_dent->name_length + 1, 0); char *name = (char *)kzalloc(target_dent->name_length + 1, 0);
strncpy(name, target_dent->name, target_dent->name_length); strncpy(name, target_dent->name, target_dent->name_length);
uint32_t dentry_type; uint32_t dentry_type;