diff options
| author | Kirill Korotaev <dev@sw.ru> | 2004-09-02 19:25:58 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-02 19:25:58 -0700 |
| commit | 16fb359f52d056dee08badbabe5aba93a8f7cbf2 (patch) | |
| tree | d38e54f9969ecc7f41b8e78f47d8570d5578ebcb | |
| parent | 25c2ccd7a712d2af8f4f40ef588ac2725494f449 (diff) | |
[PATCH] Fix do_each_task_pid() loop with 'continue' inside
Dmitry Torokhov triggered a problem in the new pidhash macros: These
do_each_task_pid()/while_each_task_pid() do loop forever if you use a
'continue' inside them.
The end of the loop has to be inside the "while()" statement, so as to
not make "continue" jump over it.
| -rw-r--r-- | include/linux/pid.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h index 5f74c4ab0d11..5b2fcb19d2da 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -46,10 +46,10 @@ extern void switch_exec_pids(struct task_struct *leader, struct task_struct *thr do { #define while_each_task_pid(who, type, task) \ - task = pid_task((task)->pids[type].pid_list.next,\ - type); \ - prefetch((task)->pids[type].pid_list.next); \ - } while (hlist_unhashed(&(task)->pids[type].pid_chain));\ + } while (task = pid_task((task)->pids[type].pid_list.next,\ + type), \ + prefetch((task)->pids[type].pid_list.next), \ + hlist_unhashed(&(task)->pids[type].pid_chain)); \ } \ #endif /* _LINUX_PID_H */ |
