diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2013-05-12 05:00:15 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2013-05-12 05:00:15 +0000 |
commit | ca941ec6b49f27b3c0f197f40eeabbe7b1d78608 (patch) | |
tree | ff673cef73c045a2009301eb33f77c72acbb6003 /usr.bin/sndiod | |
parent | c7e8d43366e0033b2630329ab1993bdd06bebcd6 (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.c | 4 |
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); } |