summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-07-24 16:19:56 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-07-24 16:19:56 +0200
commit7b15b702b1f908595a2ae484117746587f8e03aa (patch)
treede2a401793fc44ba0d52ba9f2f5b8841171794aa /apt-pkg
parent4bd60a02b45241039d4ca7b5cfaa005e552f3d0d (diff)
trigger the usage of the fallback code for kfreebsd also in the
second (filebased) constructor of DynamicMMap (Closes: #677704)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/mmap.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index f0ab49265..aaa9da44f 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -216,7 +216,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;