summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2002-08-22 21:45:58 +0000
committerJulian Elischer <julian@FreeBSD.org>2002-08-22 21:45:58 +0000
commit49539972e9daccdf4ec5ee14dc7415126efd3ccf (patch)
treea5d47668028d913f63c63c82275b6116ae3b9620 /sys/kern/kern_exec.c
parent4a6a94d8d803018858d728dad780253f98583be0 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index c01f4fa0f30c..02af5eebebd9 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -162,11 +162,19 @@ execve(td, uap)
PROC_LOCK(p);
KASSERT((p->p_flag & P_INEXEC) == 0,
("%s(): process already has P_INEXEC flag", __func__));
- if ((p->p_flag & P_KSES) && thread_single(SNGLE_EXIT)) {
- PROC_UNLOCK(p);
- return (ERESTART); /* Try again later. */
+ if (p->p_flag & P_KSES) {
+ if (thread_single(SNGLE_EXIT)) {
+ PROC_UNLOCK(p);
+ return (ERESTART); /* Try again later. */
+ }
+ /*
+ * If we get here all other threads are dead,
+ * so unset the associated flags and lose KSE mode.
+ */
+ p->p_flag &= ~P_KSES;
+ td->td_flags &= ~TDF_UNBOUND;
+ thread_single_end();
}
- /* If we get here all other threads are dead. */
p->p_flag |= P_INEXEC;
PROC_UNLOCK(p);