]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cdrom.cc
* apt-pkg/cdrom.cc:
[apt.git] / apt-pkg / cdrom.cc
index 8462e82860cd721bbe280b82fd77d03103e9e991..699f66fb3fa1618be373b036a9f2850c7625f8c8 100644 (file)
@@ -413,8 +413,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
 
    Out.close();
 
-   if (FileExists(DFile) == true && link(DFile.c_str(),string(DFile + '~').c_str()) != 0)
-      return _error->Errno("link", "Failed to link %s to %s~", DFile.c_str(), DFile.c_str());
+   if (FileExists(DFile) == true)
+      rename(DFile.c_str(), string(DFile + '~').c_str());
    if (rename(NewFile.c_str(),DFile.c_str()) != 0)
       return _error->Errno("rename","Failed to rename %s.new to %s",
                           DFile.c_str(),DFile.c_str());