udev: skipping empty udev rules file while collecting the stats

To keep align with the logic used in udev_rules_parse_file(), we also
should skip the empty udev rules file while collecting the stats during
manager reload. Otherwise all udev rules files will be parsed again whenever
reloading udev manager with an empty udev rules file. It's time consuming
and the following uevents will fail with timeout.
This commit is contained in:
Lidong Zhong
2024-11-08 23:20:09 +00:00
committed by Luca Boccassi
parent 56933f2073
commit 2ae79a31b7
+4
View File
@@ -749,6 +749,10 @@ int config_get_stats_by_path(
return -errno;
}
/* Skipping an empty file. */
if (null_or_empty(&st))
continue;
r = hashmap_put_stats_by_path(&stats_by_path, *f, &st);
if (r < 0)
return r;