alsactl: daemon mode - remove disconnected cards

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2013-04-09 18:10:22 +02:00
parent e05b903b1f
commit 9cb5e5bee7

View file

@ -431,7 +431,9 @@ int state_daemon(const char *file, const char *cardname, int period,
goto out;
}
j += cards[i]->pfds;
if (revents & POLLIN) {
if (revents & (POLLERR|POLLNVAL)) {
card_free(&cards[i]);
} else if (revents & POLLIN) {
if (card_events(cards[i])) {
/* delay the write */
if (!changed)