diff options
-rw-r--r-- | ccache.c | 1 | ||||
-rw-r--r-- | manifest.c | 1 | ||||
-rw-r--r-- | util.c | 1 |
3 files changed, 3 insertions, 0 deletions
@@ -661,6 +661,7 @@ static void to_cache(ARGS *args) char *tmp_stderr2; x_asprintf(&tmp_stderr2, "%s.tmp.stderr2.%s", cached_obj, tmp_string()); + unlink(tmp_stderr2); if (rename(tmp_stderr, tmp_stderr2)) { cc_log("Failed to rename %s to %s", tmp_stderr, tmp_stderr2); failed(); @@ -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 { @@ -329,6 +329,7 @@ move_uncompressed_file(const char *src, const char *dest, int compress_dest) if (compress_dest) { return move_file(src, dest, compress_dest); } else { + unlink(dest); return rename(src, dest); } } |