From 1ae74b66e1565b49e4e0d5b1d9d097dc65b03df8 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 14 Jul 2010 19:00:06 +0200 Subject: [PATCH] Make stats_flush an exit function --- ccache.c | 5 +---- util.c | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ccache.c b/ccache.c index a1332bfd2..556d6de40 100644 --- a/ccache.c +++ b/ccache.c @@ -253,8 +253,6 @@ static void failed(void) { char *e; - stats_flush(); - /* delete intermediate pre-processor file if needed */ if (i_tmpfile) { if (!direct_i_file) { @@ -706,7 +704,6 @@ static void to_cache(ARGS *args) if (i_tmpfile && !direct_i_file) { unlink(i_tmpfile); } - stats_flush(); exit(status); } } @@ -1288,7 +1285,6 @@ static void from_cache(enum fromcache_call_mode mode, int put_object_in_manifest } /* and exit with the right status code */ - stats_flush(); exit(0); } @@ -2140,6 +2136,7 @@ int main(int argc, char *argv[]) char *program_name; exitfn_init(); + exitfn_add_nullary(stats_flush); /* check for logging early so cc_log messages start working ASAP */ cache_logfile = getenv("CCACHE_LOGFILE"); diff --git a/util.c b/util.c index 254fbd8a9..6f7c781d3 100644 --- a/util.c +++ b/util.c @@ -135,7 +135,6 @@ void fatal(const char *format, ...) fprintf(stderr, "ccache: FATAL: %s\n", msg); - stats_flush(); exit(1); } -- 2.47.3