summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-07-08 15:28:53 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-07-08 15:28:53 +0200
commita9fe592842bfa17d91f4904d7fb0e3af3adebb17 (patch)
tree711c7ddc538476e8b88dfb8b6d76361db5754c1e /apt-pkg/pkgcache.cc
parent32b9a14cb4c6bdcddfe84c4451c225ced1a34bb7 (diff)
* apt-pkg/pkgcachegen.{cc,h}:
- make the used MMap moveable (and therefore dynamic resizeable) by applying (some) mad pointer magic (Closes: #195018)
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 68aa83d0c..8af8ef7de 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -119,7 +119,7 @@ pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map)
// Cache::ReMap - Reopen the cache file /*{{{*/
// ---------------------------------------------------------------------
/* If the file is already closed then this will open it open it. */
-bool pkgCache::ReMap()
+bool pkgCache::ReMap(bool const &Errorchecks)
{
// Apply the typecasts.
HeaderP = (Header *)Map.Data();
@@ -135,6 +135,9 @@ bool pkgCache::ReMap()
StringItemP = (StringItem *)Map.Data();
StrP = (char *)Map.Data();
+ if (Errorchecks == false)
+ return true;
+
if (Map.Size() == 0 || HeaderP == 0)
return _error->Error(_("Empty package cache"));