]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
set logfile so -c messages show up
authorWilson Snyder <wsnyder@wsnyder.org>
Thu, 10 Jun 2010 19:21:55 +0000 (15:21 -0400)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 13 Jun 2010 09:19:51 +0000 (11:19 +0200)
ccache.c

index fa54bdf4008871119149645308500a589f1ab2c6..5ba2105c5bb7a54e899ca44a985b7813f48fc676 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1818,8 +1818,6 @@ static void ccache(int argc, char *argv[])
        /* Arguments to send to the real compiler. */
        ARGS *compiler_args;
 
-       cc_log("=== CCACHE STARTED =========================================");
-
        sloppiness = parse_sloppiness(getenv("CCACHE_SLOPPINESS"));
 
        cc_log("Hostname: %s", get_hostname());
@@ -2100,6 +2098,10 @@ int main(int argc, char *argv[])
        char *p;
        char *program_name;
 
+       /* check for logging early so cc_log messages start working ASAP */
+       cache_logfile = getenv("CCACHE_LOGFILE");
+       cc_log("=== CCACHE STARTED =========================================");
+
        /* the user might have set CCACHE_UMASK */
        p = getenv("CCACHE_UMASK");
        if (p) {
@@ -2142,8 +2144,6 @@ int main(int argc, char *argv[])
                x_asprintf(&temp_dir, "%s/tmp", cache_dir);
        }
 
-       cache_logfile = getenv("CCACHE_LOGFILE");
-
        base_dir = getenv("CCACHE_BASEDIR");
        if (base_dir && base_dir[0] != '/') {
                cc_log("Ignoring non-absolute base directory %s", base_dir);