summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2020-03-08 15:15:57 +0000
committerratchov <ratchov@openbsd.org>2020-03-08 15:15:57 +0000
commitc6d259b54a8b3ee35e184da1521ef766d64512f3 (patch)
tree31fa64e8ea589bfb93040cd2e861de470b3b7e8e
parentDon't forget to notify clients when controls list is ready. (diff)
downloadwireguard-openbsd-c6d259b54a8b3ee35e184da1521ef766d64512f3.tar.xz
wireguard-openbsd-c6d259b54a8b3ee35e184da1521ef766d64512f3.zip
Wake up processes reading the mixer when the device is detached.
-rw-r--r--sys/dev/audio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 23d030090e7..35a9908e2df 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.187 2020/02/13 21:00:48 ratchov Exp $ */
+/* $OpenBSD: audio.c,v 1.188 2020/03/08 15:15:57 ratchov Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
@@ -1370,6 +1370,10 @@ audio_detach(struct device *self, int flags)
sc->ops->close(sc->arg);
sc->mode = 0;
}
+ if (sc->mix_isopen) {
+ wakeup(&sc->mix_blocking);
+ selwakeup(&sc->mix_sel);
+ }
/* free resources */
free(sc->mix_evbuf, M_DEVBUF, sc->mix_nent * sizeof(struct mixer_ev));