summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2013-10-20 13:20:14 +0000
committermiod <miod@openbsd.org>2013-10-20 13:20:14 +0000
commit3b60a78232436dc9f2d0a5ceb6acb0f4eed91a38 (patch)
tree656bd05cb0163b521e27dcd99585c6828cae963f
parentKNF a long line. (diff)
downloadwireguard-openbsd-3b60a78232436dc9f2d0a5ceb6acb0f4eed91a38.tar.xz
wireguard-openbsd-3b60a78232436dc9f2d0a5ceb6acb0f4eed91a38.zip
Allow WSDISPLAYIO_GTYPE ioctl on the tty*cfg device (passing it back to tty*0).
-rw-r--r--sys/dev/wscons/wsdisplay.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index f32a2fbdfeb..a59b9d575ae 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.114 2013/10/18 22:06:41 miod Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.115 2013/10/20 13:20:14 miod Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -1039,8 +1039,12 @@ wsdisplayioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return (error);
#endif
- if (ISWSDISPLAYCTL(dev))
- return (wsdisplay_cfg_ioctl(sc, cmd, data, flag, p));
+ if (ISWSDISPLAYCTL(dev)) {
+ if (cmd != WSDISPLAYIO_GTYPE)
+ return (wsdisplay_cfg_ioctl(sc, cmd, data, flag, p));
+ /* pass WSDISPLAYIO_GTYPE to the first screen */
+ dev = makedev(major(dev), WSDISPLAYMINOR(unit, 0));
+ }
if (WSDISPLAYSCREEN(dev) >= WSDISPLAY_MAXSCREEN)
return (ENODEV);