From: Julian Andres Klode Date: Tue, 29 Jun 2010 15:28:33 +0000 (+0200) Subject: Fix the atomic replace. X-Git-Tag: 0.8.0~9^2~23 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/fd3b761e8cba6ed626639b50b1221246098c7b3a Fix the atomic replace. --- diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 0b0739cda..0b62d1bd8 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -843,9 +843,9 @@ bool FileFd::Close() iFd = -1; if ((Flags & Replace) == Replace) { - FileName = TemporaryFileName; // for the unlink() below. if (rename(TemporaryFileName.c_str(), FileName.c_str()) != 0) Res &= _error->Errno("rename",_("Problem renaming the file")); + FileName = TemporaryFileName; // for the unlink() below. } if ((Flags & Fail) == Fail && (Flags & DelOnFail) == DelOnFail &&