]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: be more defensive in FOREACH_DEVICE_SYSATTR 16287/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 5 Jul 2020 08:55:18 +0000 (10:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 5 Jul 2020 08:55:18 +0000 (10:55 +0200)
Follow-up for fadcc1222949ed57ca2ce143f2eb9b93ea0dab1b.

src/libsystemd/sd-device/sd-device.c

index 05e3a54c10084695a80f578a6914581e5f07e714..13596f2303591c32ad6d4b04f08aa2d9d075955d 100644 (file)
@@ -1585,6 +1585,10 @@ static int device_sysattrs_read_all_internal(sd_device *device, const char *subd
                 if (access(p, F_OK) >= 0)
                         /* this is a child device, skipping */
                         return 0;
+                if (errno != ENOENT) {
+                        log_debug_errno(errno, "Failed to stat %s, ignoring subdir: %m", p);
+                        return 0;
+                }
 
                 path_dir = path_join(syspath, subdir);
                 if (!path_dir)