From cb2902b07a9530594c3981f76747c386c380fea2 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 12 May 2010 08:39:15 +0200 Subject: [PATCH] Log executed command in the parent process to get correct PID in the message --- execute.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/execute.c b/execute.c index 7eee995..73a29eb 100644 --- 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) {