mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 11:45:11 +00:00
Kernel: Fix ProcFS for non-process backed sub dirs
While hacking on `sysctl` an issue in ProcFS was making me unable to read/write from `/proc/sys/XXX`. Some directories in the ProcFS are not actually backed by a process and need to return `nullptr` so callbacks get properly set. We now do an explicit check for the parent to ensure it's one that is PID-based.
This commit is contained in:
parent
028dad6e87
commit
27bfb01f25
1 changed files with 5 additions and 1 deletions
|
@ -1045,7 +1045,11 @@ ProcFSInode::~ProcFSInode()
|
|||
|
||||
RefPtr<Process> ProcFSInode::process() const
|
||||
{
|
||||
return Process::from_pid(to_pid(identifier()));
|
||||
auto parent = to_proc_parent_directory(identifier());
|
||||
if (parent == PDI_PID || parent == PDI_PID_fd || parent == PDI_PID_stacks)
|
||||
return Process::from_pid(to_pid(identifier()));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
KResult ProcFSInode::refresh_data(FileDescription& description) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue