Windows' rename() will not overwrite existing files.
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();
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 {
if (compress_dest) {
return move_file(src, dest, compress_dest);
} else {
+ unlink(dest);
return rename(src, dest);
}
}