summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/aucat.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-11 21:26:22 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-11 21:26:22 +0000
commit59872355bb664978bb92e1d26fe40bfde1ce1444 (patch)
treed5b434de093e7fd058fca6c736de985b49989756 /usr.bin/aucat/aucat.c
parent986c635b69c9c69727ae0e32db39cf39622d5c10 (diff)
if the device disappear the mixer and demultiplexer chains are
destroyed. If this happen then warn and exit, rather than crashing.
Diffstat (limited to 'usr.bin/aucat/aucat.c')
-rw-r--r--usr.bin/aucat/aucat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 501c37e070f..8d468dbc95b 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.37 2008/11/11 13:12:03 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.38 2008/11/11 21:26:21 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -490,8 +490,10 @@ main(int argc, char **argv)
filelist_unlisten();
break;
}
- if (!file_poll())
- break;
+ if (!file_poll()) {
+ fprintf(stderr, "Terminated, device desappeared?\n");
+ exit(1);
+ }
if ((!dev_mix || dev_mix->u.mix.idle > 2 * dev_bufsz) &&
(!dev_sub || dev_sub->u.sub.idle > 2 * dev_bufsz)) {
if (!l_flag)