From 3b8c1cb01f1b752543738779668d9841ecbca0d3 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 8 Aug 2012 14:45:16 +0200 Subject: udev: initialize rules dir timestamps when reading rules On Wed, Aug 8, 2012 at 11:48 AM, Michael Schroeder wrote: > if rules are installed in the first 3 seconds after the udev start, > the stamps will all be zero, so the [first] call to check_rules_timestamp() > will just copy the current mtime [and not cause a rules re-load]. --- src/udev/udev-rules.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index d3b33e4bbf..1860455204 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1770,12 +1770,15 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) return NULL; } strv_uniq(rules->dirs); + + rules->dirs_ts_usec = calloc(strv_length(rules->dirs), sizeof(long long)); + udev_rules_check_timestamp(rules); + r = conf_files_list_strv(&files, ".rules", (const char **)rules->dirs); if (r < 0) { log_error("failed to enumerate rules files: %s\n", strerror(-r)); return NULL; } - rules->dirs_ts_usec = calloc(strv_length(rules->dirs), sizeof(long long)); /* * The offset value in the rules strct is limited; add all -- cgit v1.2.3-54-g00ecf