]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
wrap every unlink call to check for != /dev/null
[apt.git] / apt-pkg / deb / dpkgpm.cc
index ccc4b5a6c07fac2cfda180f887790638ec0e0384..1446826d6056693d3122dc6c9dfa9cd165812f68 100644 (file)
@@ -1597,7 +1597,7 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
    {
       std::string const oldpkgcache = _config->FindFile("Dir::cache::pkgcache");
       if (oldpkgcache.empty() == false && RealFileExists(oldpkgcache) == true &&
-         unlink(oldpkgcache.c_str()) == 0)
+         RemoveFile("pkgDPkgPM::Go", oldpkgcache))
       {
         std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
         if (srcpkgcache.empty() == false && RealFileExists(srcpkgcache) == true)