2005-09-18 13:39:30

by Oleg Nesterov

[permalink] [raw]
Subject: [PATCH] little de_thread() cleanup

Trivial, saves one 'if' branch in de_thread().

Signed-off-by: Oleg Nesterov <[email protected]>

--- 2.6.14-rc1/fs/exec.c~3_DETHR 2005-09-17 18:57:28.000000000 +0400
+++ 2.6.14-rc1/fs/exec.c 2005-09-18 20:14:10.000000000 +0400
@@ -639,10 +639,9 @@ static inline int de_thread(struct task_
/*
* Account for the thread group leader hanging around:
*/
- count = 2;
- if (thread_group_leader(current))
- count = 1;
- else {
+ count = 1;
+ if (!thread_group_leader(current)) {
+ count = 2;
/*
* The SIGALRM timer survives the exec, but needs to point
* at us as the new group leader now. We have a race with