]> git.alsa-project.org Git - alsa-utils.git/commitdiff
amixer: print error when snd_hctl_handle_events() fails
authorJaroslav Kysela <perex@perex.cz>
Mon, 29 Mar 2021 09:36:17 +0000 (11:36 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 29 Mar 2021 09:36:19 +0000 (11:36 +0200)
It may be possible that the controls are quickly added and
removed, thus the "hard" fail is not optimal here.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
amixer/amixer.c

index b3b9b4809cca2c2e855161e16244a693d8eaeec7..0bdae997e8a3cc52bd0d2b784780c762219a9e58 100644 (file)
@@ -1602,7 +1602,8 @@ static int events(int argc ATTRIBUTE_UNUSED, char *argv[] ATTRIBUTE_UNUSED)
                if (res >= 0) {
                        printf("Poll ok: %i\n", res);
                        res = snd_hctl_handle_events(handle);
-                       assert(res > 0);
+                       if (res < 0)
+                               printf("ERR: %s (%d)\n", snd_strerror(res), res);
                }
        }
        snd_hctl_close(handle);