]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Ignore errors with -s option
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 Jul 2007 13:19:34 +0000 (15:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 24 Jul 2007 13:19:34 +0000 (15:19 +0200)
Ignore non-fatal errors when stdin is parsed with -s option.

amixer/amixer.c

index 9c15f8cdbfbabdc9fd043c4204dcdc0a7bc39e75..7da0ebe58a001387e0a31cd956d9187867e75fbe 100644 (file)
@@ -1372,7 +1372,7 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, char **ptrp)
 static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv)
 {
        unsigned int idx, chn = 0;
-       int check_flag = -1;
+       int check_flag = ignore_error ? 0 : -1;
 
        for (idx = 1; idx < argc; idx++) {
                char *ptr = argv[idx];
@@ -1396,7 +1396,7 @@ static int sset_channels(snd_mixer_elem_t *elem, unsigned int argc, char **argv)
        unsigned int dir = 3, okflag = 3;
        unsigned int idx;
        snd_mixer_selem_channel_id_t chn;
-       int check_flag = -1;
+       int check_flag = ignore_error ? 0 : -1;
 
        for (idx = 1; idx < argc; idx++) {
                char *ptr = argv[idx], *optr;