]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Log executed command in the parent process to get correct PID in the message
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 12 May 2010 06:39:15 +0000 (08:39 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 12 May 2010 06:50:17 +0000 (08:50 +0200)
execute.c

index 7eee995a9ba70912339c307fc372f435084a504b..73a29eb38db79cba7ca125f69d889920f911cde0 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -39,17 +39,17 @@ int execute(char **argv,
        pid_t pid;
        int status;
 
+       cc_log_executed_command(argv);
+       if (getenv("CCACHE_VERBOSE")) {
+               print_executed_command(stdout, argv);
+       }
+
        pid = fork();
        if (pid == -1) fatal("Failed to fork");
 
        if (pid == 0) {
                int fd;
 
-               cc_log_executed_command(argv);
-               if (getenv("CCACHE_VERBOSE")) {
-                       print_executed_command(stdout, argv);
-               }
-
                unlink(path_stdout);
                fd = open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
                if (fd == -1) {