summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wsmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/wscons/wsmux.c')
-rw-r--r--sys/dev/wscons/wsmux.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c
index c8654dc01e1..11710829475 100644
--- a/sys/dev/wscons/wsmux.c
+++ b/sys/dev/wscons/wsmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmux.c,v 1.32 2017/06/12 13:45:39 deraadt Exp $ */
+/* $OpenBSD: wsmux.c,v 1.33 2018/11/19 19:19:24 anton Exp $ */
/* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */
/*
@@ -192,7 +192,6 @@ wsmuxopen(dev_t dev, int flags, int mode, struct proc *p)
evar = &sc->sc_base.me_evar;
wsevent_init(evar);
- evar->io = p->p_p;
#ifdef WSDISPLAY_COMPAT_RAWKBD
sc->sc_rawkbd = 0;
#endif
@@ -476,18 +475,15 @@ wsmux_do_ioctl(struct device *dv, u_long cmd, caddr_t data, int flag,
evar = sc->sc_base.me_evp;
if (evar == NULL)
return (EINVAL);
- if (-*(int *)data != evar->io->ps_pgid
- && *(int *)data != evar->io->ps_pid)
- return (EPERM);
- return (0);
+ return (sigio_setown(&evar->sigio, *(int *)data));
case TIOCSPGRP:
DPRINTF(("%s: TIOCSPGRP\n", sc->sc_base.me_dv.dv_xname));
+ if (*(int *)data < 0)
+ return (EINVAL);
evar = sc->sc_base.me_evp;
if (evar == NULL)
return (EINVAL);
- if (*(int *)data != evar->io->ps_pgid)
- return (EPERM);
- return (0);
+ return (sigio_setown(&evar->sigio, -*(int *)data));
default:
DPRINTF(("%s: unknown\n", sc->sc_base.me_dv.dv_xname));
break;