copy: a plain unlink() works here too

This commit is contained in:
Lennart Poettering
2017-02-21 21:41:32 +01:00
parent 71994cff31
commit ce21ed5c61
+1 -1
View File
@@ -558,7 +558,7 @@ int copy_file_atomic(const char *from, const char *to, mode_t mode, unsigned cha
} else
r = rename_noreplace(AT_FDCWD, t, AT_FDCWD, to);
if (r < 0) {
(void) unlink_noerrno(t);
(void) unlink(t);
return r;
}