Index: sys/kern/kern_descrip.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_descrip.c,v retrieving revision 1.313 diff -u -d -r1.313 kern_descrip.c --- sys/kern/kern_descrip.c 6 Aug 2007 14:26:00 -0000 1.313 +++ sys/kern/kern_descrip.c 4 Feb 2008 19:05:42 -0000 @@ -2046,7 +2046,7 @@ int error; *vpp = NULL; - if ((error = _fget(td, fd, &fp, 0, 0)) != 0) + if ((error = _fget(td, fd, &fp, flags, 0)) != 0) return (error); if (fp->f_vnode == NULL) { error = EINVAL; Index: sys/kern/uipc_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_syscalls.c,v retrieving revision 1.259.2.1 diff -u -d -r1.259.2.1 uipc_syscalls.c --- sys/kern/uipc_syscalls.c 1 Feb 2008 22:51:39 -0000 1.259.2.1 +++ sys/kern/uipc_syscalls.c 4 Feb 2008 19:05:42 -0000 @@ -1796,20 +1796,23 @@ goto out; vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - obj = vp->v_object; - if (obj != NULL) { - /* - * Temporarily increase the backing VM object's reference - * count so that a forced reclamation of its vnode does not - * immediately destroy it. - */ - VM_OBJECT_LOCK(obj); - if ((obj->flags & OBJ_DEAD) == 0) { - vm_object_reference_locked(obj); - VM_OBJECT_UNLOCK(obj); - } else { - VM_OBJECT_UNLOCK(obj); - obj = NULL; + if (vp->v_type == VREG) { + obj = vp->v_object; + if (obj != NULL) { + /* + * Temporarily increase the backing VM + * object's reference count so that a forced + * reclamation of its vnode does not + * immediately destroy it. + */ + VM_OBJECT_LOCK(obj); + if ((obj->flags & OBJ_DEAD) == 0) { + vm_object_reference_locked(obj); + VM_OBJECT_UNLOCK(obj); + } else { + VM_OBJECT_UNLOCK(obj); + obj = NULL; + } } } VOP_UNLOCK(vp, 0, td);