From: Joel Rosdahl Date: Sun, 22 Mar 2020 19:17:06 +0000 (+0100) Subject: Remove superfluous unlink before rename X-Git-Tag: v4.0~564 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e3a6755f2c6ce17cd7d996cbefd5e37853cd916;p=thirdparty%2Fccache.git Remove superfluous unlink before rename --- diff --git a/src/legacy_util.cpp b/src/legacy_util.cpp index 06818e280..656d91f8e 100644 --- a/src/legacy_util.cpp +++ b/src/legacy_util.cpp @@ -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; }