summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-06-01 18:50:31 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-06-01 18:50:31 +0000
commit6b2091d691e9d578078c8891320a9f3081c0e8e8 (patch)
tree72ed913cd80bdc089c7baf8b8f6356283b58dc1d
parent6995a238a0d777374f9cae7cbcfca9425e11c5db (diff)
Do not kill the event sink when closing a wsmouse device opened in write-only
mode, thus only been used to issue ioctls. This chunk was lost in r1.14; reported by Douglas Santos.
-rw-r--r--sys/dev/wscons/wsmouse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c
index 2866d67ef31..a40dbc16719 100644
--- a/sys/dev/wscons/wsmouse.c
+++ b/sys/dev/wscons/wsmouse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmouse.c,v 1.15 2005/05/18 21:31:27 miod Exp $ */
+/* $OpenBSD: wsmouse.c,v 1.16 2005/06/01 18:50:30 miod Exp $ */
/* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -506,6 +506,9 @@ wsmouseclose(dev_t dev, int flags, int mode, struct proc *p)
(struct wsmouse_softc *)wsmouse_cd.cd_devs[minor(dev)];
struct wseventvar *evar = sc->sc_base.me_evp;
+ if ((flags & (FREAD | FWRITE)) == FWRITE)
+ return (0); /* see wsmouseopen() */
+
if (evar == NULL)
/* not open for read */
return (0);