summaryrefslogtreecommitdiff
path: root/manifest.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2010-07-15 14:30:32 -0300
committerJoel Rosdahl <joel@rosdahl.net>2010-07-16 15:42:51 +0200
commitaebc480793d00a41f672606cecb9ab1f2fd4331b (patch)
tree364c72a51424fe19054242fe0cab98104bb9809b /manifest.c
parentce58d8ac8be5ee5ef0e270b75a2a3191131de3c5 (diff)
downloadccache-aebc480793d00a41f672606cecb9ab1f2fd4331b.tar.gz
Unlink destination file before renames
Windows' rename() will not overwrite existing files.
Diffstat (limited to 'manifest.c')
-rw-r--r--manifest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/manifest.c b/manifest.c
index 4ba19c77..c759f1cb 100644
--- a/manifest.c
+++ b/manifest.c
@@ -673,6 +673,7 @@ int manifest_put(const char *manifest_path, struct file_hash *object_hash,
add_object_entry(mf, object_hash, included_files);
if (write_manifest(f2, mf)) {
+ unlink(manifest_path);
if (rename(tmp_file, manifest_path) == 0) {
ret = 1;
} else {