sd-device-enumerator: do not fail when a directory vanishes on enumerate

This commit is contained in:
Yu Watanabe
2022-09-08 18:10:50 +09:00
parent cdffb95cce
commit bae477676a
+5 -2
View 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;