summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-07-09 23:06:08 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-07-09 23:06:08 +0000
commit012cb28c91af74ee2a52e92b5dc59adc4d255edb (patch)
tree330aa079ba9625d5ceb781c11c06cc599494ba0a /sys
parentebe82fe05c5ea31e320f70d08e7904f0542eec47 (diff)
The linux emulation exit hook needs to be able to sleep, so call it
before changing p_stat to SDEAD ok pirofti@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_exit.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 57c88ff8aca..22700dffbec 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.115 2012/04/14 14:26:39 kettenis Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.116 2012/07/09 23:06:07 guenther Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -244,6 +244,13 @@ exit1(struct proc *p, int rv, int flags)
if (ISSET(p->p_flag, P_SYSTRACE))
systrace_exit(p);
#endif
+
+ /*
+ * If emulation has process exit hook, call it now.
+ */
+ if (p->p_emul->e_proc_exit)
+ (*p->p_emul->e_proc_exit)(p);
+
/*
* Remove proc from pidhash chain so looking it up won't
* work. Move it from allproc to zombproc, but do not yet
@@ -340,12 +347,6 @@ exit1(struct proc *p, int rv, int flags)
*/
/*
- * If emulation has process exit hook, call it now.
- */
- if (p->p_emul->e_proc_exit)
- (*p->p_emul->e_proc_exit)(p);
-
- /*
* Finally, call machine-dependent code to switch to a new
* context (possibly the idle context). Once we are no longer
* using the dead process's vmspace and stack, exit2() will be