]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device-enumerator: do not fail when a directory vanishes on enumerate
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 8 Sep 2022 05:54:54 +0000 (14:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 8 Sep 2022 09:10:50 +0000 (18:10 +0900)
src/libsystemd/sd-device/device-enumerator.c

index fcb36f27dd32d899fcd912ee6aba400a699cddd9..5f196ab7fcc579148e9b121385ac6a0dfa33de2d 100644 (file)
@@ -862,8 +862,11 @@ static int parent_crawl_children(sd_device_enumerator *enumerator, const char *p
         int r = 0;
 
         dir = opendir(path);
-        if (!dir)
-                return log_debug_errno(errno, "sd-device-enumerator: Failed to open parent directory %s: %m", path);
+        if (!dir) {
+                if (errno == ENOENT)
+                        return 0;
+                return log_debug_errno(errno, "sd-device-enumerator: Failed to open %s: %m", path);
+        }
 
         FOREACH_DIRENT_ALL(de, dir, return -errno) {
                 _cleanup_free_ char *child = NULL;