summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wsdisplay.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-10-20 13:20:15 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-10-20 13:20:15 +0000
commit68ba6f2452bc3c40667beac4a048553790fc90b2 (patch)
tree8181363fa5ec6bfeb61942aae959dcebdb8f8951 /sys/dev/wscons/wsdisplay.c
parent8d2af8b8fe8a9fd39a667f01c6ea02349eb1bfe5 (diff)
Allow WSDISPLAYIO_GTYPE ioctl on the tty*cfg device (passing it back to tty*0).
Diffstat (limited to 'sys/dev/wscons/wsdisplay.c')
-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);