aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-01-01 00:00:05 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-01-01 00:00:05 +0000
commit47877889f2b823f4c2fa135f5f3955ce0b3bdca1 (patch)
tree55da18dd472ae2d967d5708030fd947f11aed905 /sys/kern/kern_exit.c
parent68dc94c7d314b02ef80fe972f524a2b3c6e68a1c (diff)
downloadsrc-47877889f2b823f4c2fa135f5f3955ce0b3bdca1.tar.gz
src-47877889f2b823f4c2fa135f5f3955ce0b3bdca1.zip
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 0e748751d019..e1b40a171345 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -39,6 +39,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ddb.h"
#include "opt_ktrace.h"
#include <sys/param.h>
@@ -436,6 +437,14 @@ exit1(struct thread *td, int rval, int signo)
*/
sx_xlock(&allproc_lock);
LIST_REMOVE(p, p_list);
+
+#ifdef DDB
+ /*
+ * Used by ddb's 'ps' command to find this process via the
+ * pidhash.
+ */
+ p->p_list.le_prev = NULL;
+#endif
sx_xunlock(&allproc_lock);
sx_xlock(&proctree_lock);