From 741bb5587fe02f2ea046b4bc684dc03b570ab56c Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 21 Feb 2010 20:58:58 +0100 Subject: [PATCH] Add comments about the stats files --- ccache.c | 5 ++++- stats.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ccache.c b/ccache.c index a925e23da..e79fa67ce 100644 --- a/ccache.c +++ b/ccache.c @@ -125,7 +125,10 @@ static int direct_i_file; /* 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? */ diff --git a/stats.c b/stats.c index 6cb424d4d..911448412 100644 --- a/stats.c +++ b/stats.c @@ -136,6 +136,11 @@ static void stats_update_size(enum stats stat, size_t size) 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); } -- 2.47.3