From: Lidong Zhong Date: Thu, 7 Nov 2024 06:41:11 +0000 (+0800) Subject: udev: skipping empty udev rules file while collecting the stats X-Git-Tag: v257-rc2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ae79a31b7c7947e2c16e18eb85ac5607ebc40b6;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 8c5a4a7013a..eaa8a5f11c6 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -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;