diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-16 18:23:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-16 18:23:51 +0000 |
commit | 431dd297ebcddf58fb8b6920d0f7b8ab5d057f52 (patch) | |
tree | 800466e6ece45912a4e1db5ac97f8f6c7f08d95e /sys | |
parent | 686e364d01800739167cabc704d289874b870d96 (diff) |
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
Diffstat (limited to 'sys')
-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); } |