--- zzzz-none-000/linux-2.6.13.1/kernel/exit.c 2005-09-10 02:42:58.000000000 +0000 +++ ohio-7170-487/linux-2.6.13.1/kernel/exit.c 2007-08-17 12:10:39.000000000 +0000 @@ -60,12 +60,16 @@ { int zap_leader; task_t *leader; +#if defined(CONFIG_PROC_FS) struct dentry *proc_dentry; +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ -repeat: +repeat: atomic_dec(&p->user->processes); spin_lock(&p->proc_lock); +#if defined(CONFIG_PROC_FS) proc_dentry = proc_pid_unhash(p); +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ write_lock_irq(&tasklist_lock); if (unlikely(p->ptrace)) __ptrace_unlink(p); @@ -103,7 +107,9 @@ sched_exit(p); write_unlock_irq(&tasklist_lock); spin_unlock(&p->proc_lock); +#if defined(CONFIG_PROC_FS) proc_pid_flush(proc_dentry); +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ release_thread(p); put_task_struct(p); @@ -116,15 +122,21 @@ void unhash_process(struct task_struct *p) { +#if defined(CONFIG_PROC_FS) struct dentry *proc_dentry; +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ spin_lock(&p->proc_lock); +#if defined(CONFIG_PROC_FS) proc_dentry = proc_pid_unhash(p); +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ write_lock_irq(&tasklist_lock); __unhash_process(p); write_unlock_irq(&tasklist_lock); spin_unlock(&p->proc_lock); +#if defined(CONFIG_PROC_FS) proc_pid_flush(proc_dentry); +#endif /*--- #if defined(CONFIG_PROC_FS) ---*/ } /* @@ -149,7 +161,7 @@ sid = p->signal->session; out: read_unlock(&tasklist_lock); - + return sid; } @@ -708,9 +720,9 @@ * and we were the only connection outside, so our pgrp * is about to become orphaned. */ - + t = tsk->real_parent; - + if ((process_group(t) != process_group(tsk)) && (t->signal->session == tsk->signal->session) && will_become_orphaned_pgrp(process_group(tsk), tsk) && @@ -719,10 +731,10 @@ __kill_pg_info(SIGCONT, (void *)1, process_group(tsk)); } - /* Let father know we died + /* Let father know we died * * Thread signals are configurable, but you aren't going to use - * that to send signals to arbitary processes. + * that to send signals to arbitary processes. * That stops right now. * * If the parent exec id doesn't match the exec id we saved @@ -732,9 +744,9 @@ * If our self_exec id doesn't match our parent_exec_id then * we have changed execution domain as these two values started * the same after a fork. - * + * */ - + if (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 && ( tsk->parent_exec_id != t->self_exec_id || tsk->self_exec_id != tsk->parent_exec_id) @@ -870,7 +882,7 @@ { if (comp) complete(comp); - + do_exit(code); }