summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-10-29 15:15:53 +0100
committerTom Gundersen <teg@jklm.no>2013-10-29 16:12:11 +0100
commit97f2d76d4f4dfab8b0629c09926a05a1e5621125 (patch)
tree3b6042e8487f4b02bc7dc74233dd9f65b5bd1801 /src/udev/udev-rules.c
parentdabfa9d1efd0d1a7e0507d69f9789bc6404ff786 (diff)
path_check_timestamp: only keep the most recent timestamp
There is no point in keeping one timestamp for each directory, as we only ever care about the most recent one.
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 58da79b876..4437d80529 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -49,7 +49,7 @@ struct uid_gid {
struct udev_rules {
struct udev *udev;
char **dirs;
- usec_t *dirs_ts_usec;
+ usec_t dirs_ts_usec;
int resolve_names;
/* every key in the rules file becomes a token */
@@ -1653,9 +1653,6 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
}
strv_uniq(rules->dirs);
- rules->dirs_ts_usec = calloc(strv_length(rules->dirs), sizeof(usec_t));
- if(!rules->dirs_ts_usec)
- return udev_rules_unref(rules);
udev_rules_check_timestamp(rules);
r = conf_files_list_strv(&files, ".rules", NULL, (const char **)rules->dirs);
@@ -1711,14 +1708,13 @@ struct udev_rules *udev_rules_unref(struct udev_rules *rules)
free(rules->uids);
free(rules->gids);
strv_free(rules->dirs);
- free(rules->dirs_ts_usec);
free(rules);
return NULL;
}
bool udev_rules_check_timestamp(struct udev_rules *rules)
{
- return paths_check_timestamp(rules->dirs, rules->dirs_ts_usec, true);
+ return paths_check_timestamp(rules->dirs, &rules->dirs_ts_usec, true);
}
static int match_key(struct udev_rules *rules, struct token *token, const char *val)