diff options
author | Lidong Zhong <lidong.zhong@suse.com> | 2024-11-07 07:41:11 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-11-09 00:20:09 +0100 |
commit | 2ae79a31b7c7947e2c16e18eb85ac5607ebc40b6 (patch) | |
tree | 63f2fe88e7e04988d51ede1b728f35a88bbcf745 /src/shared/conf-parser.c | |
parent | uid-classification: properly classify *all* container UIDs (diff) | |
download | systemd-2ae79a31b7c7947e2c16e18eb85ac5607ebc40b6.tar.xz systemd-2ae79a31b7c7947e2c16e18eb85ac5607ebc40b6.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/shared/conf-parser.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 8c5a4a7013..eaa8a5f11c 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; |