]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove superfluous unlink before rename
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 22 Mar 2020 19:17:06 +0000 (20:17 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 22 Mar 2020 19:26:45 +0000 (20:26 +0100)
src/legacy_util.cpp

index 06818e2809bfc3591c92153534a6f00ad6786fd2..656d91f8ea225f742477c8679ab8377e2344bb33 100644 (file)
@@ -178,7 +178,6 @@ clone_file(const char* src, const char* dest, bool via_tmp_file)
   close(src_fd);
 
   if (via_tmp_file) {
-    x_try_unlink(dest);
     if (x_rename(tmp_file, dest) != 0) {
       result = false;
     }
@@ -238,7 +237,6 @@ copy_file(const char* src, const char* dest, bool via_tmp_file)
   close(src_fd);
 
   if (via_tmp_file) {
-    x_try_unlink(dest);
     if (x_rename(tmp_file, dest) != 0) {
       result = false;
     }