Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71486
b: refs/heads/master
c: 9a2e705
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and Linus Torvalds committed Oct 19, 2007
1 parent 3e14014 commit bacc3f8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 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: 270f722d4d5f94b02fd48eed47e57917ab00a858
refs/heads/master: 9a2e70572e94e21e7ec4186702d045415422bda0
3 changes: 0 additions & 3 deletions trunk/include/linux/init_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@
.posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
.cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
.rlim = INIT_RLIMITS, \
.pgrp = 0, \
.tty_old_pgrp = NULL, \
{ .__session = 0}, \
}

extern struct nsproxy init_nsproxy;
Expand Down
19 changes: 17 additions & 2 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,17 @@ struct signal_struct {
cputime_t it_prof_incr, it_virt_incr;

/* job control IDs */
pid_t pgrp;

/*
* pgrp and session fields are deprecated.
* use the task_session_Xnr and task_pgrp_Xnr routines below
*/

union {
pid_t pgrp __deprecated;
pid_t __pgrp;
};

struct pid *tty_old_pgrp;

union {
Expand Down Expand Up @@ -1196,6 +1206,11 @@ static inline void set_task_session(struct task_struct *tsk, pid_t session)
tsk->signal->__session = session;
}

static inline void set_task_pgrp(struct task_struct *tsk, pid_t pgrp)
{
tsk->signal->__pgrp = pgrp;
}

static inline struct pid *task_pid(struct task_struct *task)
{
return task->pids[PIDTYPE_PID].pid;
Expand Down Expand Up @@ -1268,7 +1283,7 @@ static inline pid_t task_tgid_vnr(struct task_struct *tsk)

static inline pid_t task_pgrp_nr(struct task_struct *tsk)
{
return tsk->signal->pgrp;
return tsk->signal->__pgrp;
}

pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns);
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void __set_special_pids(pid_t session, pid_t pgrp)
}
if (task_pgrp_nr(curr) != pgrp) {
detach_pid(curr, PIDTYPE_PGID);
curr->signal->pgrp = pgrp;
set_task_pgrp(curr, pgrp);
attach_pid(curr, PIDTYPE_PGID, find_pid(pgrp));
}
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,13 +1293,13 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if (clone_flags & CLONE_NEWPID) {
p->nsproxy->pid_ns->child_reaper = p;
p->signal->tty = NULL;
p->signal->pgrp = p->pid;
set_task_pgrp(p, p->pid);
set_task_session(p, p->pid);
attach_pid(p, PIDTYPE_PGID, pid);
attach_pid(p, PIDTYPE_SID, pid);
} else {
p->signal->tty = current->signal->tty;
p->signal->pgrp = task_pgrp_nr(current);
set_task_pgrp(p, task_pgrp_nr(current));
set_task_session(p, task_session_nr(current));
attach_pid(p, PIDTYPE_PGID,
task_pgrp(current));
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
detach_pid(p, PIDTYPE_PGID);
pid = find_vpid(pgid);
attach_pid(p, PIDTYPE_PGID, pid);
p->signal->pgrp = pid_nr(pid);
set_task_pgrp(p, pid_nr(pid));
}

err = 0;
Expand Down

0 comments on commit bacc3f8

Please sign in to comment.