summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2012-07-27 19:18:59 +0200
committerMichael Vogt <egon@debian-devbox>2012-07-27 19:18:59 +0200
commitb9c917bd62e7b1eb227d4f3a7321559ddb96e494 (patch)
tree3169d9875a6b94fbf03d3eb8ab265e67b40d4b25 /apt-pkg/contrib
parent24123a1f4341dfc45481af1a8462d7f9aeecc746 (diff)
parentfbda0ee9d9f5ecd34d38f0e416837e8ef3a10f68 (diff)
merged from david0.9.7.3
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/mmap.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index 593bb063b..3e6ef3520 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -102,6 +102,7 @@ bool MMap::Map(FileFd &Fd)
{
// for readonly, we don't need sync, so make it simple
Base = malloc(iSize);
+ SyncToFd = new FileFd();
return Fd.Read(Base, iSize);
}
// FIXME: Writing to compressed fd's ?
@@ -216,7 +217,17 @@ DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long const &Work
{
if (_error->PendingError() == true)
return;
-
+
+ // disable Moveable if we don't grow
+ if (Grow == 0)
+ this->Flags &= ~Moveable;
+
+#ifndef __linux__
+ // kfreebsd doesn't have mremap, so we use the fallback
+ if ((this->Flags & Moveable) == Moveable)
+ this->Flags |= Fallback;
+#endif
+
unsigned long long EndOfFile = Fd->Size();
if (EndOfFile > WorkSpace)
WorkSpace = EndOfFile;
@@ -328,7 +339,7 @@ unsigned long DynamicMMap::RawAllocate(unsigned long long Size,unsigned long Aln
if(!Grow())
{
_error->Fatal(_("Dynamic MMap ran out of room. Please increase the size "
- "of APT::Cache-Limit. Current value: %lu. (man 5 apt.conf)"), WorkSpace);
+ "of APT::Cache-Start. Current value: %lu. (man 5 apt.conf)"), WorkSpace);
return 0;
}
}