]> git.saurik.com Git - apt.git/commitdiff
do not fail if an unrelated error is pending in DisplayRecord()
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 5 Jun 2010 17:14:32 +0000 (19:14 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 5 Jun 2010 17:14:32 +0000 (19:14 +0200)
cmdline/apt-cache.cc

index ef074280e825a2e279cffad4f63fb841f6d15b6d..de4288c5a8392e0f4fd8e8be79c9cc5698533493 100644 (file)
@@ -1243,11 +1243,11 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
    pkgCache::PkgFileIterator I = Vf.File();
    if (I.IsOk() == false)
       return _error->Error(_("Package file %s is out of sync."),I.FileName());
-   
-   FileFd PkgF(I.FileName(),FileFd::ReadOnly);
-   if (_error->PendingError() == true)
+
+   FileFd PkgF;
+   if (PkgF.Open(I.FileName(), FileFd::ReadOnly) == false)
       return false;
-   
+
    // Read the record
    unsigned char *Buffer = new unsigned char[Cache->HeaderP->MaxVerFileSize+1];
    Buffer[V.FileList()->Size] = '\n';