Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16995
b: refs/heads/master
c: e19f247
h: refs/heads/master
i:
  16993: af038e3
  16991: 54619c1
v: v3
  • Loading branch information
Oren Laadan authored and Linus Torvalds committed Jan 9, 2006
1 parent 3dc7916 commit 4a6375d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 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: ee0acf90d320c29916ba8c5c1b2e908d81f5057d
refs/heads/master: e19f247a3dbd85485ec13174817ae9c2478fe541
2 changes: 1 addition & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static inline void reparent_to_init(void)

void __set_special_pids(pid_t session, pid_t pgrp)
{
struct task_struct *curr = current;
struct task_struct *curr = current->group_leader;

if (curr->signal->session != session) {
detach_pid(curr, PIDTYPE_SID);
Expand Down
16 changes: 7 additions & 9 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,24 +1215,22 @@ asmlinkage long sys_getsid(pid_t pid)

asmlinkage long sys_setsid(void)
{
struct task_struct *group_leader = current->group_leader;
struct pid *pid;
int err = -EPERM;

if (!thread_group_leader(current))
return -EINVAL;

down(&tty_sem);
write_lock_irq(&tasklist_lock);

pid = find_pid(PIDTYPE_PGID, current->pid);
pid = find_pid(PIDTYPE_PGID, group_leader->pid);
if (pid)
goto out;

current->signal->leader = 1;
__set_special_pids(current->pid, current->pid);
current->signal->tty = NULL;
current->signal->tty_old_pgrp = 0;
err = process_group(current);
group_leader->signal->leader = 1;
__set_special_pids(group_leader->pid, group_leader->pid);
group_leader->signal->tty = NULL;
group_leader->signal->tty_old_pgrp = 0;
err = process_group(group_leader);
out:
write_unlock_irq(&tasklist_lock);
up(&tty_sem);
Expand Down

0 comments on commit 4a6375d

Please sign in to comment.