From 9c03a8ae91e06e47f0c59996ef0e2300e231e101 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 24 Apr 2001 00:51:53 +0000 Subject: Change the pfind() and zpfind() functions to lock the process that they find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake --- sys/fs/procfs/procfs_subr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/fs/procfs/procfs_subr.c') diff --git a/sys/fs/procfs/procfs_subr.c b/sys/fs/procfs/procfs_subr.c index 035eb75..b960b13 100644 --- a/sys/fs/procfs/procfs_subr.c +++ b/sys/fs/procfs/procfs_subr.c @@ -252,11 +252,13 @@ procfs_rw(ap) int rtval; p = PFIND(pfs->pfs_pid); - if (p == 0) + if (p == NULL) return (EINVAL); + PROC_UNLOCK(p); if (p->p_pid == 1 && securelevel > 0 && uio->uio_rw == UIO_WRITE) return (EACCES); + mp_fixme("pfs_lockowner needs a lock"); while (pfs->pfs_lockowner) { tsleep(&pfs->pfs_lockowner, PRIBIO, "pfslck", 0); } -- cgit v1.1