diff options
Diffstat (limited to 'src/boot/bootctl-install.c')
-rw-r--r-- | src/boot/bootctl-install.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/boot/bootctl-install.c b/src/boot/bootctl-install.c index 624b88abe3..9fee309328 100644 --- a/src/boot/bootctl-install.c +++ b/src/boot/bootctl-install.c @@ -262,13 +262,14 @@ static int copy_file_with_version_check(const char *from, const char *to, bool f r = fsync_full(fd_to); if (r < 0) { - (void) unlink_noerrno(t); + (void) unlink(t); return log_error_errno(r, "Failed to copy data from \"%s\" to \"%s\": %m", from, t); } - if (renameat(AT_FDCWD, t, AT_FDCWD, to) < 0) { - (void) unlink_noerrno(t); - return log_error_errno(errno, "Failed to rename \"%s\" to \"%s\": %m", t, to); + r = RET_NERRNO(renameat(AT_FDCWD, t, AT_FDCWD, to)); + if (r < 0) { + (void) unlink(t); + return log_error_errno(r, "Failed to rename \"%s\" to \"%s\": %m", t, to); } log_info("Copied \"%s\" to \"%s\".", from, to); |