mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-19 05:33:43 -04:00
ucm: fix optional include
The path is not an absolute path and can't be used with `access()`. Let's call `uc_mgr_config_load_file()` directly and mask acceptable error numbers. Closes: https://github.com/alsa-project/alsa-lib/pull/499 Signed-off-by: Huang Yunxuan <hyx0329@outlook.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d8ca4a7cc4
commit
62c24074ae
1 changed files with 3 additions and 4 deletions
|
|
@ -90,11 +90,10 @@ static int include_eval_one(snd_use_case_mgr_t *uc_mgr,
|
|||
err = uc_mgr_get_substituted_value(uc_mgr, &s, file);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (opt_bool && access(s, R_OK) != 0) {
|
||||
snd_trace(UCM, "optional file '%s' not found", s);
|
||||
err = uc_mgr_config_load_file(uc_mgr, s, result);
|
||||
if (opt_bool && (err == -ENOENT || err == -EACCES)) {
|
||||
snd_trace(UCM, "optional file '%s' not found or readable", s);
|
||||
err = 0;
|
||||
} else {
|
||||
err = uc_mgr_config_load_file(uc_mgr, s, result);
|
||||
}
|
||||
free(s);
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue