From: Oleg Nesterov <oleg@tv-sign.ru>

Replace open-coded thread_group_leader() calls.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/binfmt_elf.c |    2 +-
 25-akpm/fs/exec.c       |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -puN fs/binfmt_elf.c~dont-hide-thread_group_leader-from-grep fs/binfmt_elf.c
--- 25/fs/binfmt_elf.c~dont-hide-thread_group_leader-from-grep	2004-12-03 20:56:32.599804264 -0800
+++ 25-akpm/fs/binfmt_elf.c	2004-12-03 20:56:32.606803200 -0800
@@ -1201,7 +1201,7 @@ static void fill_prstatus(struct elf_prs
 	prstatus->pr_ppid = p->parent->pid;
 	prstatus->pr_pgrp = process_group(p);
 	prstatus->pr_sid = p->signal->session;
-	if (p->pid == p->tgid) {
+	if (thread_group_leader(p)) {
 		/*
 		 * This is the record for the group leader.  Add in the
 		 * cumulative times of previous dead threads.  This total
diff -puN fs/exec.c~dont-hide-thread_group_leader-from-grep fs/exec.c
--- 25/fs/exec.c~dont-hide-thread_group_leader-from-grep	2004-12-03 20:56:32.601803960 -0800
+++ 25-akpm/fs/exec.c	2004-12-03 20:56:32.607803048 -0800
@@ -617,7 +617,7 @@ static inline int de_thread(struct task_
 	 * Account for the thread group leader hanging around:
 	 */
 	count = 2;
-	if (current->pid == current->tgid)
+	if (thread_group_leader(current))
 		count = 1;
 	while (atomic_read(&sig->count) > count) {
 		sig->group_exit_task = current;
@@ -636,7 +636,7 @@ static inline int de_thread(struct task_
 	 * do is to wait for the thread group leader to become inactive,
 	 * and to assume its PID:
 	 */
-	if (current->pid != current->tgid) {
+	if (!thread_group_leader(current)) {
 		struct task_struct *leader = current->group_leader, *parent;
 		struct dentry *proc_dentry1, *proc_dentry2;
 		unsigned long exit_state, ptrace;
@@ -746,7 +746,7 @@ no_thread_group:
 
 	if (!thread_group_empty(current))
 		BUG();
-	if (current->tgid != current->pid)
+	if (!thread_group_leader(current))
 		BUG();
 	return 0;
 }
_