mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 07:55:07 +00:00
Kernel: Make RAMFS pass along the inode type when traversing as a dir
RAMFS was passing 0, which lead to the userspace seeing all entries as DT_UNKNOWN when iterating over the directory contents. To repro prior to this commit, simply check `echo /tmp/*/`.
This commit is contained in:
parent
24a7df9b09
commit
b545427d53
3 changed files with 63 additions and 4 deletions
|
@ -37,4 +37,27 @@ unsigned RAMFS::next_inode_index()
|
|||
return m_next_inode_index++;
|
||||
}
|
||||
|
||||
u8 RAMFS::internal_file_type_to_directory_entry_type(DirectoryEntryView const& entry) const
|
||||
{
|
||||
switch (static_cast<FileType>(entry.file_type)) {
|
||||
case FileType::Directory:
|
||||
return DT_DIR;
|
||||
case FileType::Character:
|
||||
return DT_CHR;
|
||||
case FileType::Block:
|
||||
return DT_BLK;
|
||||
case FileType::Regular:
|
||||
return DT_REG;
|
||||
case FileType::FIFO:
|
||||
return DT_FIFO;
|
||||
case FileType::Link:
|
||||
return DT_LNK;
|
||||
case FileType::Socket:
|
||||
return DT_SOCK;
|
||||
case FileType::Unknown:
|
||||
default:
|
||||
return DT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue