]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-files: fstatat() sets errno on failure
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 28 Jun 2025 02:00:56 +0000 (11:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 29 Jun 2025 01:15:56 +0000 (10:15 +0900)
Follow-up for 50c81130b69d04288f50217bede709bac6ca2b1a.

src/basic/conf-files.c

index 0f736202e5a8a7adeb80587bd891d2a9db255455..49fa1dce798e394a221755ae4c624b140bd32fb3 100644 (file)
@@ -100,13 +100,10 @@ static int files_add(
                                 continue;
                         }
 
-                        if (need_stat) {
-                                r = fstatat(rfd, resolved_path, &st, AT_SYMLINK_NOFOLLOW);
-                                if (r < 0) {
-                                        log_debug_errno(r, "Failed to stat '%s/%s', ignoring: %m",
-                                                        root, skip_leading_slash(p));
-                                        continue;
-                                }
+                        if (need_stat && fstatat(rfd, resolved_path, &st, AT_SYMLINK_NOFOLLOW) < 0) {
+                                log_debug_errno(errno, "Failed to stat '%s/%s', ignoring: %m",
+                                                root, skip_leading_slash(p));
+                                continue;
                         }
 
                 } else {