Skip to content

Commit 6c3d369

Browse files
ldzhongbluca
authored andcommitted
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. (cherry picked from commit 2ae79a3) (cherry picked from commit 688eb20) (cherry picked from commit 484d31a) (cherry picked from commit 8b6ae95) (cherry picked from commit e0b8d73)
1 parent fedf2c5 commit 6c3d369

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/shared/conf-parser.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ int config_get_stats_by_path(
694694
return -errno;
695695
}
696696

697+
/* Skipping an empty file. */
698+
if (null_or_empty(&st))
699+
continue;
700+
697701
r = hashmap_put_stats_by_path(&stats_by_path, *f, &st);
698702
if (r < 0)
699703
return r;

0 commit comments

Comments
 (0)