summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/midi.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-11-14 13:51:28 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-11-14 13:51:28 +0000
commit3aa67c975489621d72955e0c11f343ab08e520e7 (patch)
treefc6a414e546d9f45164957b99b55e79c6dc2dd7b /usr.bin/aucat/midi.c
parent2e00e7bcf510d4ae4057a23f19232a59919844a0 (diff)
Terminate midi thru boxes trying to drain but that have no
outputs anymore, otherwise they can't be cleaned up by dev_close()
Diffstat (limited to 'usr.bin/aucat/midi.c')
-rw-r--r--usr.bin/aucat/midi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/aucat/midi.c b/usr.bin/aucat/midi.c
index e56a4bcb97e..b252cb65bb0 100644
--- a/usr.bin/aucat/midi.c
+++ b/usr.bin/aucat/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.30 2010/10/21 19:10:52 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.31 2010/11/14 13:51:27 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -271,13 +271,17 @@ thru_eof(struct aproc *p, struct abuf *ibuf)
{
if (!(p->flags & APROC_QUIT))
return;
- if (LIST_EMPTY(&p->ins))
+ if (LIST_EMPTY(&p->ins) || LIST_EMPTY(&p->outs))
aproc_del(p);
}
void
thru_hup(struct aproc *p, struct abuf *obuf)
{
+ if (!(p->flags & APROC_QUIT))
+ return;
+ if (LIST_EMPTY(&p->outs))
+ aproc_del(p);
}
void