From 99a4d67e7b6b851f119157dd26cae0d64abb3a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 25 Mar 2005 18:38:27 +0000 Subject: [PATCH] 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 --- src/kernel/core/team.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 {