mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-08 23:05:42 +01:00
alsactl: init - iterate through all cards for the initial settings
The generic initialization code returns error code 99 (-99). Take all those codes equal or above (bellow) this value as non-fatal. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
f9abf36d34
commit
598488c4af
1 changed files with 7 additions and 1 deletions
|
@ -1745,7 +1745,7 @@ static int parse(struct space *space, const char *filename)
|
|||
int init(const char *filename, const char *cardname)
|
||||
{
|
||||
struct space *space;
|
||||
int err = 0, card, first;
|
||||
int err = 0, lasterr = 0, card, first;
|
||||
|
||||
sysfs_init();
|
||||
if (!cardname) {
|
||||
|
@ -1767,11 +1767,17 @@ int init(const char *filename, const char *cardname)
|
|||
space->rootdir = new_root_dir(filename);
|
||||
if (space->rootdir != NULL)
|
||||
err = parse(space, filename);
|
||||
if (err <= -99) { /* non-fatal errors */
|
||||
if (lasterr == 0)
|
||||
lasterr = err;
|
||||
err = 0;
|
||||
}
|
||||
free_space(space);
|
||||
}
|
||||
if (err < 0)
|
||||
break;
|
||||
}
|
||||
err = lasterr;
|
||||
} else {
|
||||
card = snd_card_get_index(cardname);
|
||||
if (card < 0) {
|
||||
|
|
Loading…
Reference in a new issue