Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95254
b: refs/heads/master
c: 12a3de0
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Apr 30, 2008
1 parent 93192b0 commit 88e5ad5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1dd768c0815334d2319d6377f0750ace075b6142
refs/heads/master: 12a3de0a965826096d8adc593bcf4392a7d5b459
36 changes: 21 additions & 15 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,31 +991,37 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)

asmlinkage long sys_getpgid(pid_t pid)
{
struct task_struct *p;
struct pid *grp;
int retval;

rcu_read_lock();
if (!pid)
return task_pgrp_vnr(current);
grp = task_pgrp(current);
else {
int retval;
struct task_struct *p;

read_lock(&tasklist_lock);
p = find_task_by_vpid(pid);
retval = -ESRCH;
if (p) {
retval = security_task_getpgid(p);
if (!retval)
retval = task_pgrp_vnr(p);
}
read_unlock(&tasklist_lock);
return retval;
p = find_task_by_vpid(pid);
if (!p)
goto out;
grp = task_pgrp(p);
if (!grp)
goto out;

retval = security_task_getpgid(p);
if (retval)
goto out;
}
retval = pid_vnr(grp);
out:
rcu_read_unlock();
return retval;
}

#ifdef __ARCH_WANT_SYS_GETPGRP

asmlinkage long sys_getpgrp(void)
{
/* SMP - assuming writes are word atomic this is fine */
return task_pgrp_vnr(current);
return sys_getpgid(0);
}

#endif
Expand Down

0 comments on commit 88e5ad5

Please sign in to comment.