diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-03-26 16:12:16 +0100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-03-26 16:12:16 +0100 |
commit | f171a5c9ffbcf3083dbcbccdb9a7f39442598157 (patch) | |
tree | 1a677586d0d0909baae3f46392edef3b6e4892db /execute.c | |
parent | ecb3bfc6e8b5083342ddcb35cb6f26b8f6199b2b (diff) | |
download | ccache-f171a5c9ffbcf3083dbcbccdb9a7f39442598157.tar.gz |
delete files before creation
Diffstat (limited to 'execute.c')
-rw-r--r-- | execute.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |