]> git.alsa-project.org Git - alsa-lib.git/commit
conf: Use ino64_t to save and compare inode numbers
authorSimon McVittie <smcv@collabora.com>
Wed, 25 May 2022 11:33:42 +0000 (12:33 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 5 Jun 2022 08:24:26 +0000 (10:24 +0200)
commit87ff5318e327eb2343f10bd73dce5a32f12db622
tree3bcb7b60495e706db00abeb04ca8f914aa369a09
parentd836146e919d5444cc43ac5dbf65b50d16f511dd
conf: Use ino64_t to save and compare inode numbers

On 32-bit platforms when not using the large-file-support ABI,
struct stat64 contains ino64_t which is 64-bit, while ino_t is only
32-bit.

snd_config_update_r() checks whether a file has been replaced by saving
the ino member of a struct stat64 and comparing it with a previously-saved
inode number. On 32-bit platforms, assigning the 64-bit member of struct
stat64 to a 32-bit member of struct finfo will truncate it modulo 1<<32,
which could conceivably result in libasound not reloading configuration
when it should (although the inode number space is large enough to make
this failure mode highly unlikely).

Fixes: https://github.com/alsa-project/alsa-lib/pull/231
Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
include/local.h
src/conf.c