From 2e68619a9f31985b9d45441a46a33e2fdc542141 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 8 Jan 2009 17:52:15 +0000 Subject: add some missing stats and logging git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11039 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CCache/ccache.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'CCache/ccache.c') diff --git a/CCache/ccache.c b/CCache/ccache.c index 0de4e4136..d1696da88 100644 --- a/CCache/ccache.c +++ b/CCache/ccache.c @@ -125,6 +125,7 @@ static void failed(void) if ((e=getenv("CCACHE_PREFIX"))) { char *p = find_executable(e, MYNAME); if (!p) { + cc_log("could not find executable (%s)\n", e); perror(e); exit(1); } @@ -535,8 +536,8 @@ static void find_hash(ARGS *args) correct i_tmpfile */ path_stdout = x_strdup(input_file); if (create_empty_file(path_stderr) != 0) { - stats_update(STATS_ERROR); cc_log("failed to create empty stderr file\n"); + stats_update(STATS_ERROR); failed(); } status = 0; @@ -592,6 +593,7 @@ static void find_hash(ARGS *args) char *p; if (create_dir(hash_dir) != 0) { cc_log("failed to create %s\n", hash_dir); + stats_update(STATS_ERROR); failed(); } x_asprintf(&p, "%s/%c", hash_dir, s[i]); @@ -600,6 +602,7 @@ static void find_hash(ARGS *args) } if (create_dir(hash_dir) != 0) { cc_log("failed to create %s\n", hash_dir); + stats_update(STATS_ERROR); failed(); } x_asprintf(&hashname, "%s/%s", hash_dir, s+nlevels); @@ -785,6 +788,7 @@ static void find_compiler(int argc, char **argv) /* can't find the compiler! */ if (!orig_args->argv[0]) { stats_update(STATS_COMPILER); + cc_log("could not find compiler (%s)\n", base); perror(base); exit(1); } @@ -1069,6 +1073,7 @@ static void process_args(int argc, char **argv) if (p) { if (strlen(p) < 2) { + cc_log("badly formed dependency file %s\n", output_file); stats_update(STATS_ARGS); failed(); return; @@ -1105,6 +1110,8 @@ static void process_args(int argc, char **argv) if ((e=getenv("CCACHE_PREFIX"))) { char *p = find_executable(e, MYNAME); if (!p) { + cc_log("could not find executable (%s)\n", e); + stats_update(STATS_ENVIRONMMENT); perror(e); exit(1); } @@ -1288,6 +1295,7 @@ static void setup_uncached_err(void) uncached_fd = dup(2); if (uncached_fd == -1) { cc_log("dup(2) failed\n"); + stats_update(STATS_ERROR); failed(); } @@ -1296,6 +1304,7 @@ static void setup_uncached_err(void) if (putenv(buf) == -1) { cc_log("putenv failed\n"); + stats_update(STATS_ERROR); failed(); } } -- cgit v1.2.1