Skip to content

Commit 53f4ff4

Browse files
committed
sound/midi: midi_poll always failing
Due to two typos, midi_poll was always failing, as the 'revents' field was not properly set. Signed-off-by: Nicolas Provost <[email protected]>
1 parent a067eb5 commit 53f4ff4

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

sys/dev/sound/midi/midi.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -658,21 +658,19 @@ midi_poll(struct cdev *i_dev, int events, struct thread *td)
658658
mtx_lock(&m->lock);
659659
mtx_lock(&m->qlock);
660660

661-
if (events & (POLLIN | POLLRDNORM))
661+
if (events & (POLLIN | POLLRDNORM)) {
662662
if (!MIDIQ_EMPTY(m->inq))
663-
events |= events & (POLLIN | POLLRDNORM);
664-
665-
if (events & (POLLOUT | POLLWRNORM))
666-
if (MIDIQ_AVAIL(m->outq) < m->hiwat)
667-
events |= events & (POLLOUT | POLLWRNORM);
668-
669-
if (revents == 0) {
670-
if (events & (POLLIN | POLLRDNORM))
663+
revents |= events & (POLLIN | POLLRDNORM);
664+
else
671665
selrecord(td, &m->rsel);
672-
673-
if (events & (POLLOUT | POLLWRNORM))
666+
}
667+
if (events & (POLLOUT | POLLWRNORM)) {
668+
if (MIDIQ_AVAIL(m->outq) < m->hiwat)
669+
revents |= events & (POLLOUT | POLLWRNORM);
670+
else
674671
selrecord(td, &m->wsel);
675672
}
673+
676674
mtx_unlock(&m->lock);
677675
mtx_unlock(&m->qlock);
678676

0 commit comments

Comments
 (0)