summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-30 08:35:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-30 08:35:40 +0000
commit0309da4faac3a72eeb137355b5a86cd20a4c502b (patch)
tree17070a56dcf77c24e7d3beab8c99e438a9066f6d /sys/kern
parent7ea78dd02395485638dcc4edca5cefe5489f69fd (diff)
from netbsd:
Remove the process from zombproc and its parent's child list before freeing its resources.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exit.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 27a12beee9a..c696ac37c62 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exit.c,v 1.34 1995/12/09 04:09:32 mycroft Exp $ */
+/* $NetBSD: kern_exit.c,v 1.35 1995/12/24 11:23:33 mycroft Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -332,15 +332,17 @@ loop:
FREE(p->p_ru, M_ZOMBIE);
/*
- * Decrement the count of procs running with this uid.
+ * Finally finished with old proc entry.
+ * Unlink it from its process group and free it.
*/
- (void)chgproccnt(p->p_cred->p_ruid, -1);
+ leavepgrp(p);
+ LIST_REMOVE(p, p_list); /* off zombproc */
+ LIST_REMOVE(p, p_sibling);
/*
- * Release reference to text vnode
+ * Decrement the count of procs running with this uid.
*/
- if (p->p_textvp)
- vrele(p->p_textvp);
+ (void)chgproccnt(p->p_cred->p_ruid, -1);
/*
* Free up credentials.
@@ -351,12 +353,10 @@ loop:
}
/*
- * Finally finished with old proc entry.
- * Unlink it from its process group and free it.
+ * Release reference to text vnode
*/
- leavepgrp(p);
- LIST_REMOVE(p, p_list); /* off zombproc */
- LIST_REMOVE(p, p_sibling);
+ if (p->p_textvp)
+ vrele(p->p_textvp);
/*
* Give machine-dependent layer a chance