ucm: Use LFS calls (stat, scandir)

Continue the work in commit ba86ac55 ("conf: Use LFS calls when reading
config files") and fix the UCM code, too.

Fixes: https://github.com/alsa-project/alsa-lib/pull/223
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2022-05-19 17:37:46 +02:00
parent 45b65fa4c1
commit edec439a0c
4 changed files with 19 additions and 19 deletions

View file

@ -499,7 +499,7 @@ static char *rval_env(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char *i
static char *rval_sysfs(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char *id)
{
char path[PATH_MAX], link[PATH_MAX + 1];
struct stat sb;
struct stat64 sb;
ssize_t len;
const char *e;
int fd;
@ -510,7 +510,7 @@ static char *rval_sysfs(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char
if (id[0] == '/')
id++;
snprintf(path, sizeof(path), "%s/%s", e, id);
if (lstat(path, &sb) != 0)
if (lstat64(path, &sb) != 0)
return NULL;
if (S_ISLNK(sb.st_mode)) {
len = readlink(path, link, sizeof(link) - 1);