<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;

Replace open-coded thread_group_leader() calls.

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

 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-11-15 20:01:42.819167456 -0800
+++ 25-akpm/fs/binfmt_elf.c	2004-11-15 20:01:42.826166392 -0800
@@ -1198,7 +1198,7 @@ static void fill_prstatus(struct elf_prs
 	prstatus-&gt;pr_ppid = p-&gt;parent-&gt;pid;
 	prstatus-&gt;pr_pgrp = process_group(p);
 	prstatus-&gt;pr_sid = p-&gt;signal-&gt;session;
-	if (p-&gt;pid == p-&gt;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-11-15 20:01:42.821167152 -0800
+++ 25-akpm/fs/exec.c	2004-11-15 20:01:42.828166088 -0800
@@ -614,7 +614,7 @@ static inline int de_thread(struct task_
 	 * Account for the thread group leader hanging around:
 	 */
 	count = 2;
-	if (current-&gt;pid == current-&gt;tgid)
+	if (thread_group_leader(current))
 		count = 1;
 	while (atomic_read(&amp;sig-&gt;count) &gt; count) {
 		sig-&gt;group_exit_task = current;
@@ -633,7 +633,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-&gt;pid != current-&gt;tgid) {
+	if (!thread_group_leader(current)) {
 		struct task_struct *leader = current-&gt;group_leader, *parent;
 		struct dentry *proc_dentry1, *proc_dentry2;
 		unsigned long exit_state, ptrace;
@@ -743,7 +743,7 @@ no_thread_group:
 
 	if (!thread_group_empty(current))
 		BUG();
-	if (current-&gt;tgid != current-&gt;pid)
+	if (!thread_group_leader(current))
 		BUG();
 	return 0;
 }
_
</pre></body></html>