diff options
author | 2015-11-16 18:23:50 +0000 | |
---|---|---|
committer | 2015-11-16 18:23:50 +0000 | |
commit | 4948a23e267b8a0339efa4d17b41fa326b16e3d5 (patch) | |
tree | 04ed81ab41e2da73363f6a567eb124863dd6770e | |
parent | pledge calendar: (diff) | |
download | wireguard-openbsd-4948a23e267b8a0339efa4d17b41fa326b16e3d5.tar.xz wireguard-openbsd-4948a23e267b8a0339efa4d17b41fa326b16e3d5.zip |
In getdevvp() set the VISTTY flag on a vnode to indicate the underlying
device is a D_TTY device. (Like spec_open, but this sets the flag to
satisfy pre-VOP_OPEN situations)
ok millert semarie tedu guenther
-rw-r--r-- | sys/kern/vfs_subr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a78a8aee979..0bcfe9804b3 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.236 2015/10/13 09:11:48 guenther Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.237 2015/11/16 18:23:50 deraadt Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -49,6 +49,7 @@ #include <sys/time.h> #include <sys/fcntl.h> #include <sys/kernel.h> +#include <sys/conf.h> #include <sys/vnode.h> #include <sys/lock.h> #include <sys/stat.h> @@ -500,6 +501,8 @@ getdevvp(dev_t dev, struct vnode **vpp, enum vtype type) vput(vp); vp = nvp; } + if (vp->v_type == VCHR && cdevsw[major(vp->v_rdev)].d_type == D_TTY) + vp->v_flag |= VISTTY; *vpp = vp; return (0); } |