]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Log executed commands
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 9 May 2010 20:51:16 +0000 (22:51 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 9 May 2010 20:51:16 +0000 (22:51 +0200)
ccache.c
ccache.h
execute.c
util.c

index 2fc0658e35ee537f832fe8b90f19f07a85fddea5..a4f0c3e8da3af5589fc8f2b110ec38c6f263fffa 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -248,6 +248,7 @@ static void failed(void)
        }
 
        cc_log("Failed; falling back to running the real compiler");
+       cc_log_executed_command(orig_args->argv);
        if (getenv("CCACHE_VERBOSE")) {
                print_executed_command(stdout, orig_args->argv);
        }
index a3072dfecc1d5e08e622c0a99782a3491b434e43..7d50b2dd2002ac44b574c07df5d7a341b4f257c6 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -67,6 +67,7 @@ void hash_buffer(struct mdfour *md, const void *s, size_t len);
 
 void cc_log_no_newline(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
 void cc_log(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
+void cc_log_executed_command(char **argv);
 void fatal(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
 
 void copy_fd(int fd_in, int fd_out);
index d20f2c92269d3918e54ac2ee66ffeb1f78157135..7eee995a9ba70912339c307fc372f435084a504b 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -45,6 +45,7 @@ int execute(char **argv,
        if (pid == 0) {
                int fd;
 
+               cc_log_executed_command(argv);
                if (getenv("CCACHE_VERBOSE")) {
                        print_executed_command(stdout, argv);
                }
diff --git a/util.c b/util.c
index 9f90efd9f6673c433e6d6d482644f6df7e743fcf..a53e2df2f6b551da5299eb75c3c0d82addd9a8ad 100644 (file)
--- a/util.c
+++ b/util.c
@@ -80,6 +80,13 @@ void cc_log(const char *format, ...)
        fflush(logfile);
 }
 
+void cc_log_executed_command(char **argv)
+{
+       cc_log_no_newline("Executing ");
+       print_command(logfile, argv);
+       fflush(logfile);
+}
+
 /* something went badly wrong! */
 void fatal(const char *format, ...)
 {