mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:37:34 +00:00
ProcFS: Ignore directories in refresh_data().
This commit is contained in:
parent
0ba42260e8
commit
ff7dee49f6
1 changed files with 5 additions and 6 deletions
|
@ -1081,17 +1081,16 @@ ProcFSInode::~ProcFSInode()
|
||||||
|
|
||||||
KResult ProcFSInode::refresh_data(FileDescription& description) const
|
KResult ProcFSInode::refresh_data(FileDescription& description) const
|
||||||
{
|
{
|
||||||
|
if (Kernel::is_directory(identifier()))
|
||||||
|
return KSuccess;
|
||||||
|
|
||||||
auto& cached_data = description.data();
|
auto& cached_data = description.data();
|
||||||
auto* directory_entry = fs().get_directory_entry(identifier());
|
auto* directory_entry = fs().get_directory_entry(identifier());
|
||||||
|
|
||||||
bool (*read_callback)(InodeIdentifier, KBufferBuilder&) = nullptr;
|
bool (*read_callback)(InodeIdentifier, KBufferBuilder&) = nullptr;
|
||||||
if (directory_entry) {
|
if (directory_entry) {
|
||||||
if (directory_entry->proc_file_type > (unsigned)FI_Root) {
|
read_callback = directory_entry->read_callback;
|
||||||
read_callback = directory_entry->read_callback;
|
ASSERT(read_callback);
|
||||||
ASSERT(read_callback);
|
|
||||||
} else {
|
|
||||||
return KSuccess;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
switch (to_proc_parent_directory(identifier())) {
|
switch (to_proc_parent_directory(identifier())) {
|
||||||
case PDI_PID_fd:
|
case PDI_PID_fd:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue