]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: daemon mode - remove disconnected cards
authorJaroslav Kysela <perex@perex.cz>
Tue, 9 Apr 2013 16:10:22 +0000 (18:10 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 9 Apr 2013 16:10:22 +0000 (18:10 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/daemon.c

index 34056a33f9d56e86821a0537fde655630baec404..127701efaf0fdf59dc8adfd336018056e7d50906 100644 (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)