diff --git a/src/kernel/core/team.c b/src/kernel/core/team.c index 9a9d048632..b798fcf1a1 100644 --- a/src/kernel/core/team.c +++ b/src/kernel/core/team.c @@ -2075,8 +2075,14 @@ _user_setpgid(pid_t processID, pid_t groupID) teamID = currentTeam->id; // we must not change our process group ID if we're a group leader - if (is_process_group_leader(currentTeam)) + if (is_process_group_leader(currentTeam)) { + // if the group ID was not specified, we just return the + // process ID as we already are a process group leader + if (groupID == 0) + return processID; + return B_NOT_ALLOWED; + } status = B_OK; } else {