Subject: [PATCH] pspace: count the pspace leader in both pspaces From: Eric W. Biederman Date: 1134575501 -0700 This lets /proc trivially get the count of the number of directories right. And seems to better describe the situation of that procecess as it has one pid in both pspaces. --- kernel/exit.c | 1 + kernel/fork.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) 58a4a11dfae3a25ef0bdbace59a829bc4a594a0f diff --git a/kernel/exit.c b/kernel/exit.c index 1133ac0..2e91f52 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -56,6 +56,7 @@ static void __unhash_process(struct task } if (pspace_leader(p)) { detach_pid(p, PIDTYPE_WID); + p->pspace->parent->nr_processes--; } REMOVE_LINKS(p); diff --git a/kernel/fork.c b/kernel/fork.c index 0cbba91..073041f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1163,6 +1163,7 @@ static task_t *copy_process(unsigned lon p->signal->tty = NULL; p->signal->tty_old_pgrp = 0; attach_pid(p, p->pspace->parent, PIDTYPE_WID, p->wid); + p->pspace->parent->nr_processes++; } attach_pid(p, p->pspace, PIDTYPE_TID, p->tid); attach_pid(p, p->pspace, PIDTYPE_TGID, p->tgid); -- 1.0.GIT