mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Kernel: Don't try to allocate ProcessProcFSTraits in Process constructor
This commit is contained in:
parent
1c543598f1
commit
2641a068dc
Notes:
sideshowbarker
2024-07-18 04:34:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2641a068dc7
1 changed files with 2 additions and 5 deletions
|
@ -245,11 +245,6 @@ Process::Process(const String& name, UserID uid, GroupID gid, ProcessID ppid, bo
|
|||
m_protected_values.suid = uid;
|
||||
m_protected_values.sgid = gid;
|
||||
|
||||
auto maybe_procfs_traits = ProcessProcFSTraits::try_create({}, make_weak_ptr());
|
||||
// NOTE: This can fail, but it should be very, *very* rare.
|
||||
VERIFY(!maybe_procfs_traits.is_error());
|
||||
m_procfs_traits = maybe_procfs_traits.release_value();
|
||||
|
||||
dbgln_if(PROCESS_DEBUG, "Created new process {}({})", m_name, this->pid().value());
|
||||
}
|
||||
|
||||
|
@ -272,6 +267,8 @@ KResult Process::attach_resources(NonnullOwnPtr<Memory::AddressSpace>&& prealloc
|
|||
// FIXME: Figure out if this is really necessary.
|
||||
first_thread->detach();
|
||||
}
|
||||
|
||||
m_procfs_traits = TRY(ProcessProcFSTraits::try_create({}, make_weak_ptr()));
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue