setpgid(0, 0) should just return the process ID if the process is already a group leader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11995 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2075,8 +2075,14 @@ _user_setpgid(pid_t processID, pid_t groupID)
|
|||||||
teamID = currentTeam->id;
|
teamID = currentTeam->id;
|
||||||
|
|
||||||
// we must not change our process group ID if we're a group leader
|
// 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;
|
return B_NOT_ALLOWED;
|
||||||
|
}
|
||||||
|
|
||||||
status = B_OK;
|
status = B_OK;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user