summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-01-16 23:18:32 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2010-01-16 23:18:32 +0000
commit0fd234220139583c84bfe38245ae1b91e0ecd24f (patch)
tree1e17f20ef4717cc1cdcb3572169cc626b5bd6779 /usr.bin/aucat
parent80f811026e158b4f0b1f827bf4e917e8ec4d3a53 (diff)
when closing the device, delete its MIDI end, if it has no writers.
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r--usr.bin/aucat/dev.c4
-rw-r--r--usr.bin/aucat/midi.c8
2 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c
index 28665e77e17..8e3a2e4fe45 100644
--- a/usr.bin/aucat/dev.c
+++ b/usr.bin/aucat/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.42 2010/01/13 10:02:52 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.43 2010/01/16 23:18:31 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -335,6 +335,8 @@ dev_done(void)
}
if (dev_midi) {
dev_midi->flags |= APROC_QUIT;
+ if (LIST_EMPTY(&dev_midi->ibuflist))
+ aproc_del(dev_midi);
restart_midi:
LIST_FOREACH(f, &file_list, entry) {
if (f->rproc &&
diff --git a/usr.bin/aucat/midi.c b/usr.bin/aucat/midi.c
index 352dcab7543..c502d750043 100644
--- a/usr.bin/aucat/midi.c
+++ b/usr.bin/aucat/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.14 2010/01/10 21:47:41 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.15 2010/01/16 23:18:31 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -268,17 +268,13 @@ thru_eof(struct aproc *p, struct abuf *ibuf)
{
if (!(p->flags & APROC_QUIT))
return;
- if (LIST_EMPTY(&p->obuflist) || LIST_EMPTY(&p->ibuflist))
+ if (LIST_EMPTY(&p->ibuflist))
aproc_del(p);
}
void
thru_hup(struct aproc *p, struct abuf *obuf)
{
- if (!(p->flags & APROC_QUIT))
- return;
- if (LIST_EMPTY(&p->obuflist) || LIST_EMPTY(&p->ibuflist))
- aproc_del(p);
}
void