From: Ray Strode Date: Thu, 28 Dec 2023 17:10:57 +0000 (-0500) Subject: ply-utils: Use lstat instead of stat for ply_file_exists X-Git-Tag: 24.004.60~15^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e989867f4871bba564cd5dcc0de64da8ead36058;p=thirdparty%2Fplymouth.git ply-utils: Use lstat instead of stat for ply_file_exists If a file is a symlink, we usually want to follow it, so testing the symlink itself, is less than optimal. This commit switches to lstat instead of stat. --- diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c index 95b505b1..a71d8de8 100644 --- a/src/libply/ply-utils.c +++ b/src/libply/ply-utils.c @@ -518,7 +518,7 @@ ply_file_exists (const char *file) { struct stat file_info; - if (stat (file, &file_info) < 0) + if (lstat (file, &file_info) < 0) return false; return S_ISREG (file_info.st_mode);