From 16fb359f52d056dee08badbabe5aba93a8f7cbf2 Mon Sep 17 00:00:00 2001 From: Kirill Korotaev Date: Thu, 2 Sep 2004 19:25:58 -0700 Subject: [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. --- include/linux/pid.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') 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 */ -- cgit v1.2.3