}
}
- /* update timestamps for LRU cleanup
- also gives output_file a sensible mtime when hard-linking (for make) */
-#ifdef HAVE_UTIMES
- utimes(object_path, NULL);
- utimes(stderr_file, NULL);
+ /* Update modification timestamps to save files from LRU cleanup.
+ Also gives files a sensible mtime when hard-linking. */
+ update_mtime(object_path);
+ update_mtime(stderr_file);
if (produce_dep_file) {
- utimes(dep_file, NULL);
+ update_mtime(dep_file);
}
-#else
- utime(object_path, NULL);
- utime(stderr_file, NULL);
- if (produce_dep_file) {
- utime(dep_file, NULL);
- }
-#endif
if (generating_dependencies && mode != FROMCACHE_DIRECT_MODE) {
/* Store the dependency file in the cache. */
if (manifest_put(manifest_path, object_hash, included_files)) {
cc_log("Added object file hash to manifest %s\n",
manifest_path);
- /* Update timestamp for LRU cleanup. */
-#ifdef HAVE_UTIMES
- utimes(manifest_path, NULL);
-#else
- utime(manifest_path, NULL);
-#endif
+ update_mtime(manifest_path);
} else {
cc_log("Failed to add object file hash to manifest\n");
}
char *get_cwd();
size_t common_dir_prefix_length(const char *s1, const char *s2);
char *get_relative_path(const char *from, const char *to);
+void update_mtime(const char *path);
void stats_update(enum stats stat);
void stats_zero(void);