Skip to content

Commit

Permalink
Make getpgid less confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Oct 12, 2020
1 parent 7d7c576 commit 9173dd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ dword_t sys_setpgrp() {
pid_t_ sys_getpgid(pid_t_ pid) {
STRACE("getpgid(%d)", pid);
lock(&pids_lock);
struct task *task;
if (!(task = !pid ? current : pid_get_task(pid))) {
struct task *task = current;
if (pid != 0)
task = pid_get_task(pid);
if (!task) {
unlock(&pids_lock);
return _ESRCH;
}
Expand Down

0 comments on commit 9173dd6

Please sign in to comment.