aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/exec.c1
-rw-r--r--include/linux/sched.h6
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 8dca45b0dae8..c3d517bfdd27 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -963,6 +963,7 @@ static int de_thread(struct task_struct *tsk)
963 leader->group_leader = tsk; 963 leader->group_leader = tsk;
964 964
965 tsk->exit_signal = SIGCHLD; 965 tsk->exit_signal = SIGCHLD;
966 leader->exit_signal = -1;
966 967
967 BUG_ON(leader->exit_state != EXIT_ZOMBIE); 968 BUG_ON(leader->exit_state != EXIT_ZOMBIE);
968 leader->exit_state = EXIT_DEAD; 969 leader->exit_state = EXIT_DEAD;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 39acee2c8929..b38ed51d5c64 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2284,8 +2284,10 @@ static inline int get_nr_threads(struct task_struct *tsk)
2284 return tsk->signal->nr_threads; 2284 return tsk->signal->nr_threads;
2285} 2285}
2286 2286
2287/* de_thread depends on thread_group_leader not being a pid based check */ 2287static inline bool thread_group_leader(struct task_struct *p)
2288#define thread_group_leader(p) (p == p->group_leader) 2288{
2289 return p->exit_signal >= 0;
2290}
2289 2291
2290/* Do to the insanities of de_thread it is possible for a process 2292/* Do to the insanities of de_thread it is possible for a process
2291 * to have the pid of the thread group leader without actually being 2293 * to have the pid of the thread group leader without actually being