Skip to content

Commit e0b8d73

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)
1 parent 3ddb795 commit e0b8d73

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
@@ -693,6 +693,10 @@ int config_get_stats_by_path(
693693
return -errno;
694694
}
695695

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

0 commit comments

Comments
 (0)