trigger the usage of the fallback code for kfreebsd also in the
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 24 Jul 2012 14:19:56 +0000 (16:19 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 24 Jul 2012 14:19:56 +0000 (16:19 +0200)
second (filebased) constructor of DynamicMMap (Closes: #677704)

apt-pkg/contrib/mmap.cc
debian/changelog

index f0ab492..aaa9da4 100644 (file)
@@ -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;
index ea15159..25f658f 100644 (file)
@@ -14,6 +14,8 @@ apt (0.9.7.3) UNRELEASED; urgency=low
     - do not segfault if nothing can be configured to statisfy
       a pre-depends (e.g. in a pre-depends loop) (Closes: #681958)
   * apt-pkg/contrib/mmap.cc:
+    - trigger the usage of the fallback code for kfreebsd also in the
+      second (filebased) constructor of DynamicMMap (Closes: #677704)
     - refer to APT::Cache-Start in case the growing failed as if -Limit is
       really the offender it will be noted in a previous error message.