]> git.saurik.com Git - apt.git/commitdiff
Fix the atomic replace.
authorJulian Andres Klode <jak@debian.org>
Tue, 29 Jun 2010 15:28:33 +0000 (17:28 +0200)
committerJulian Andres Klode <jak@debian.org>
Tue, 29 Jun 2010 15:28:33 +0000 (17:28 +0200)
apt-pkg/contrib/fileutl.cc

index 0b0739cda5a7ad7d5f0a8f73ffbd07423485f992..0b62d1bd836de1059040c81454490d20728d7318 100644 (file)
@@ -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 &&