summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
commite47f00743fc4776491344f2c618cc8dc2c23bcbc (patch)
tree13e03a113a82a184c51c19c209867cfd3a59b3b9 /kernel/exit.c
parentb2ad5f821b1381492d792ca10b1eb7a107b48f14 (diff)
Merge with Linux 2.4.0.
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 50a9f51de..cd642927b 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -382,6 +382,7 @@ static void exit_notify(void)
*/
write_lock_irq(&tasklist_lock);
+ current->state = TASK_ZOMBIE;
do_notify_parent(current, current->exit_signal);
while (current->p_cptr != NULL) {
p = current->p_cptr;
@@ -415,9 +416,6 @@ static void exit_notify(void)
}
}
write_unlock_irq(&tasklist_lock);
-
- if (current->leader)
- disassociate_ctty(1);
}
NORET_TYPE void do_exit(long code)
@@ -437,20 +435,26 @@ fake_volatile:
#ifdef CONFIG_BSD_PROCESS_ACCT
acct_process(code);
#endif
+ __exit_mm(tsk);
+
lock_kernel();
sem_exit();
- __exit_mm(tsk);
__exit_files(tsk);
__exit_fs(tsk);
exit_sighand(tsk);
exit_thread();
- tsk->state = TASK_ZOMBIE;
- tsk->exit_code = code;
- exit_notify();
+
+ if (current->leader)
+ disassociate_ctty(1);
+
put_exec_domain(tsk->exec_domain);
if (tsk->binfmt && tsk->binfmt->module)
__MOD_DEC_USE_COUNT(tsk->binfmt->module);
+
+ tsk->exit_code = code;
+ exit_notify();
schedule();
+ BUG();
/*
* In order to get rid of the "volatile function does return" message
* I did this little loop that confuses gcc to think do_exit really