summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2013-05-12 05:00:15 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2013-05-12 05:00:15 +0000
commitca941ec6b49f27b3c0f197f40eeabbe7b1d78608 (patch)
treeff673cef73c045a2009301eb33f77c72acbb6003 /usr.bin/sndiod
parentc7e8d43366e0033b2630329ab1993bdd06bebcd6 (diff)
Fix reversed condition to check if a midi port is referenced,
causing sometimes the port to be closed prematurely
Diffstat (limited to 'usr.bin/sndiod')
-rw-r--r--usr.bin/sndiod/midi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sndiod/midi.c b/usr.bin/sndiod/midi.c
index 637d88fb716..d5a6721cb43 100644
--- a/usr.bin/sndiod/midi.c
+++ b/usr.bin/sndiod/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.7 2012/12/20 16:15:55 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.8 2013/05/12 05:00:14 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -511,7 +511,7 @@ port_unref(struct port *c)
#endif
for (rxmask = 0, i = 0; i < MIDI_NEP; i++)
rxmask |= midi_ep[i].txmask;
- if ((rxmask & c->midi->self) == 0 && c->state == PORT_INIT && !c->hold)
+ if ((rxmask & ~c->midi->self) == 0 && c->state == PORT_INIT && !c->hold)
port_drain(c);
}