/* the name of the cpp stderr file */
static char *cpp_stderr;
-/* the name of the statistics file */
+/*
+ * Full path to the statistics file in the subdirectory where the cached result
+ * belongs (CCACHE_DIR/X/stats).
+ */
char *stats_file = NULL;
/* can we safely use the unification hashing backend? */
if (getenv("CCACHE_NOSTATS")) return;
if (!stats_file) {
+ /*
+ * A NULL stats file means that we didn't get past find_hash(),
+ * so we update the counter in the cache-wide statistics file
+ * CCACHE_DIR/stats instead of a subdirectory stats file.
+ */
if (!cache_dir) return;
x_asprintf(&stats_file, "%s/stats", cache_dir);
}