summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-01-09 20:27:42 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-01-09 20:27:42 -0500
commitbf8193ca9ec1f360e020d77200ead2257db0c5e2 (patch)
treeab4241e8e837f8851271d322a7f5cd259cf68d14 /src/udev/udev-rules.c
parentdfc40b59c95f4bc1773c4f03c72e0da18147e11c (diff)
udev: move udev_rules_check_timestamp to shared
I want to use this from a bulitin in a subsequent patch. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index c5dff9903c..18749f5edb 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1723,32 +1723,7 @@ struct udev_rules *udev_rules_unref(struct udev_rules *rules)
bool udev_rules_check_timestamp(struct udev_rules *rules)
{
- unsigned int i;
- bool changed = false;
-
- if (rules == NULL)
- goto out;
-
- for (i = 0; rules->dirs[i]; i++) {
- struct stat stats;
-
- if (stat(rules->dirs[i], &stats) < 0)
- continue;
-
- if (rules->dirs_ts_usec[i] == timespec_load(&stats.st_mtim))
- continue;
-
- /* first check */
- if (rules->dirs_ts_usec[i] != 0) {
- log_debug("reload - timestamp of '%s' changed\n", rules->dirs[i]);
- changed = true;
- }
-
- /* update timestamp */
- rules->dirs_ts_usec[i] = timespec_load(&stats.st_mtim);
- }
-out:
- return changed;
+ 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)