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].
This commit is contained in:
Kay Sievers 2012-08-08 14:45:16 +02:00
parent 5ea373e101
commit 3b8c1cb01f
1 changed files with 4 additions and 1 deletions

View File

@ -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