summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-11-09 14:27:53 +0000
committerAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-11-09 14:27:53 +0000
commitd05164a9cb9c6df1eddedb55ae8d04f958766a74 (patch)
treea86a89b9c2b3b8dfce2649b4f468506f878c929a
parent33290b80f9f3bf4efe2940d17cb9dd063980baf1 (diff)
If directly open /dev/wskbdX, then wskbdX be removed from mux wskbd,
but if close wskbdX, wskbdX not returned to mux. Fix it. ok miod@
-rw-r--r--sys/dev/wscons/wskbd.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index 5fac46762db..0802530e338 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.69 2011/06/24 19:47:49 naddy Exp $ */
+/* $OpenBSD: wskbd.c,v 1.70 2011/11/09 14:27:52 shadchin Exp $ */
/* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */
/*
@@ -825,6 +825,21 @@ wskbdclose(dev_t dev, int flags, int mode, struct proc *p)
(void)wskbd_enable(sc, 0);
wsevent_fini(evar);
+#if NWSMUX > 0
+ if (sc->sc_base.me_parent == NULL) {
+ int mux, error;
+
+ DPRINTF(("wskbdclose: attach\n"));
+ mux = sc->sc_base.me_dv.dv_cfdata->wskbddevcf_mux;
+ if (mux >= 0) {
+ error = wsmux_attach_sc(wsmux_getmux(mux), &sc->sc_base);
+ if (error)
+ printf("%s: can't attach mux (error=%d)\n",
+ sc->sc_base.me_dv.dv_xname, error);
+ }
+ }
+#endif
+
return (0);
}