mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
Kernel: Make ProcessGroup::find_or_create API OOM safe
Make ProcessGroup::find_or_create & ProcessGroup::create OOM safe, by moving to adopt_ref_if_nonnull.
This commit is contained in:
parent
7540f4268b
commit
bb91bed576
3 changed files with 9 additions and 6 deletions
|
@ -116,6 +116,9 @@ KResultOr<int> Process::sys$setpgid(pid_t specified_pid, pid_t specified_pgid)
|
|||
}
|
||||
// FIXME: There are more EPERM conditions to check for here..
|
||||
process->m_pg = ProcessGroup::find_or_create(new_pgid);
|
||||
if (!process->m_pg) {
|
||||
return ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue