From cdc496addb28784ae6bc43efc5afa67cba073fde Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 1 Feb 2010 13:22:39 +0100 Subject: amixer: fix display of unreadable control elements When an element is marked as not readble, do not try to read it and then complain about the error, but just ignore it. Signed-off-by: Clemens Ladisch --- amixer/amixer.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'amixer') diff --git a/amixer/amixer.c b/amixer/amixer.c index 9620721..7b55035 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -602,6 +602,8 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, break; } if (level & LEVEL_BASIC) { + if (!snd_ctl_elem_info_is_readable(info)) + goto __skip_read; if ((err = snd_hctl_elem_read(elem, control)) < 0) { error("Control %s element read error: %s\n", card, snd_strerror(err)); return err; @@ -638,6 +640,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, } } printf("\n"); + __skip_read: if (!snd_ctl_elem_info_is_tlv_readable(info)) goto __skip_tlv; tlv = malloc(4096); -- cgit v1.2.1