]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
delete files before creation
authorAndrew Tridgell <tridge@samba.org>
Tue, 26 Mar 2002 15:12:16 +0000 (16:12 +0100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 26 Mar 2002 15:12:16 +0000 (16:12 +0100)
execute.c

index 98766fd733204b50b51f739daac4adc5208ea9b2..4d70ce4ecb49dfa54c35ff870128f63403724c68 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -18,6 +18,7 @@ void execute(char **argv,
        if (pid == -1) fatal("Failed to fork");
        
        if (pid == 0) {
+               unlink(path_stdout);
                fd = open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644);
                if (fd == -1) {
                        exit(STATUS_NOCACHE);
@@ -25,6 +26,7 @@ void execute(char **argv,
                dup2(fd, 1);
                close(fd);
 
+               unlink(path_stderr);
                fd = open(path_stderr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644);
                if (fd == -1) {
                        exit(STATUS_NOCACHE);