diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 142a6565b489..1c6a508c772e 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.86 2006/03/01 12:38:21 yamt Exp $ */ +/* $NetBSD: kern_proc.c,v 1.87 2006/03/12 10:32:47 yamt Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.86 2006/03/01 12:38:21 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.87 2006/03/12 10:32:47 yamt Exp $"); #include "opt_kstack.h" @@ -1238,7 +1238,9 @@ proc_vmspace_getref(struct proc *p, struct vmspace **vm) /* XXXCDC: how should locking work here? */ - if ((p->p_flag & P_WEXIT) != 0 || + /* curproc exception is for coredump. */ + + if ((p != curproc && (p->p_flag & P_WEXIT) != 0) || (p->p_vmspace->vm_refcnt < 1)) { /* XXX */ return EFAULT; }