summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_proc.c5
-rw-r--r--sys/kern/kern_sysctl.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index a54ca2ceef3..20884921077 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_proc.c,v 1.42 2010/03/24 23:18:17 tedu Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.43 2010/07/10 21:29:37 guenther Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
@@ -464,7 +464,8 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif)
case 'n':
db_printf("%5d %5d %5d %d %#10x "
"%-12.12s %-16s\n",
- pp ? pp->p_pid : -1, p->p_pgrp->pg_id,
+ pp ? pp->p_pid : -1,
+ p->p_pgrp ? p->p_pgrp->pg_id : -1,
p->p_cred->p_ruid, p->p_stat, p->p_flag,
(p->p_wchan && p->p_wmesg) ?
p->p_wmesg : "", p->p_comm);
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 41bf6d4f76f..9fc2b8e78f2 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.188 2010/07/02 18:14:40 guenther Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.189 2010/07/10 21:29:37 guenther Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -1372,6 +1372,11 @@ again:
*/
if (p->p_stat == SIDL)
continue;
+
+ /* XXX skip processes in the middle of being zapped */
+ if (p->p_pgrp == NULL)
+ continue;
+
/*
* TODO - make more efficient (see notes below).
*/