summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-08-08 14:45:16 +0200
committerKay Sievers <kay@vrfy.org>2012-08-08 14:45:16 +0200
commit3b8c1cb01f1b752543738779668d9841ecbca0d3 (patch)
treef71664c869bd0ac2726871b42e35e69ac2c95a00
parent5ea373e101fe7153b0038d9cde015de5f6a6d314 (diff)
udev: initialize rules dir timestamps when reading rules
On Wed, Aug 8, 2012 at 11:48 AM, Michael Schroeder <mls@suse.de> 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].
-rw-r--r--src/udev/udev-rules.c5
1 files changed, 4 insertions, 1 deletions
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