diff options
author | Tom Gundersen <teg@jklm.no> | 2013-10-26 00:36:49 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-10-26 14:34:31 +0200 |
commit | 8e18485284a8718d4a9111b7c1ed91cb2f9634b0 (patch) | |
tree | 4d12da40f925b3ba15c1d34d11e97f9871b08da5 /src/udev | |
parent | 5ecb28f69ef670c7e194b656b57fda6f8850f0ba (diff) |
udev: move udev_rules_check_timestamp to shared
I want to use this from a bulitin in a subsequent patch.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-rules.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 9d9529a0fe..58da79b876 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1718,32 +1718,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) |