mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +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:
committed by
Andreas Kling
parent
24a7df9b09
commit
b545427d53
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user