return -ENOENT;
}
}
+
+bool paths_check_timestamp(char **paths, usec_t *timestamp, bool update)
+{
+ unsigned int i;
+ bool changed = false;
+
+ assert(timestamp);
+
+ if (paths == NULL)
+ goto out;
+
+ for (i = 0; paths[i]; i++) {
+ struct stat stats;
+
+ if (stat(paths[i], &stats) < 0)
+ continue;
+
+ /* first check */
+ if (*timestamp >= timespec_load(&stats.st_mtim))
+ continue;
+
+ log_debug("timestamp of '%s' changed\n", paths[i]);
+ changed = true;
+
+ /* update timestamp */
+ if (update)
+ *timestamp = timespec_load(&stats.st_mtim);
+ }
+out:
+ return changed;
+}