1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

Kernel: Remove unnecessary logic in kill() and killpg() syscalls

As Sergey pointed out, do_killpg() already interprets PID 0 as the
PGID of the calling process.
This commit is contained in:
Andreas Kling 2020-01-03 12:58:59 +01:00
parent f081990717
commit 1dc64ec064

View file

@ -1689,8 +1689,6 @@ int Process::sys$killpg(int pgrp, int signum)
return -EINVAL;
InterruptDisabler disabler;
if (pgrp == 0)
return do_killpg(m_pgid, signum);
return do_killpg(pgrp, signum);
}
@ -1791,9 +1789,7 @@ int Process::sys$kill(pid_t pid, int signal)
{
if (signal < 0 || signal >= 32)
return -EINVAL;
if (pid == 0)
return do_killpg(m_pgid, signal);
if (pid < 0)
if (pid <= 0)
return do_killpg(-pid, signal);
if (pid == -1) {
// FIXME: Send to all processes.