diff -urN 2.4.19pre8ac1/kernel/exit.c 2.4.19pre8ac2/kernel/exit.c --- 2.4.19pre8ac1/kernel/exit.c Wed May 8 16:11:20 2002 +++ 2.4.19pre8ac2/kernel/exit.c Sun May 12 02:07:29 2002 @@ -198,7 +198,7 @@ /* * When we die, we re-parent all our children. - * Try to give them to another thread in our process + * Try to give them to another thread in our thread * group, and if no such member exists, give it to * the global child reaper process (ie "init") */ @@ -208,8 +208,14 @@ read_lock(&tasklist_lock); - /* Next in our thread group */ - reaper = next_thread(father); + /* Next in our thread group, if they're not already exiting */ + reaper = father; + do { + reaper = next_thread(reaper); + if (!(reaper->flags & PF_EXITING)) + break; + } while (reaper != father); + if (reaper == father) reaper = child_reaper;