1
Fork 0
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:
Brian Gianforcaro 2021-05-18 02:07:25 -07:00 committed by Andreas Kling
parent 7540f4268b
commit bb91bed576
3 changed files with 9 additions and 6 deletions

View file

@ -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;
}