From f608397595b520a8a6842dfcaafd6356571220a3 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 15 Nov 2004 21:56:42 +0000 Subject: [PATCH] Give vn_poll single exit point (to make it easier to insert "mtx_unlock(&Giant)" real soon now). --- sys/kern/vfs_vnops.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index d8196889dc1..37204f319df 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -848,9 +848,7 @@ vn_poll(fp, events, active_cred, td) struct thread *td; { struct vnode *vp; -#ifdef MAC int error; -#endif GIANT_REQUIRED; @@ -859,11 +857,11 @@ vn_poll(fp, events, active_cred, td) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); error = mac_check_vnode_poll(active_cred, fp->f_cred, vp); VOP_UNLOCK(vp, 0, td); - if (error) - return (error); + if (!error) #endif - return (VOP_POLL(vp, events, fp->f_cred, td)); + error = VOP_POLL(vp, events, fp->f_cred, td); + return (error); } /*