]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/mmap.cc
trigger the usage of the fallback code for kfreebsd also in the
[apt.git] / apt-pkg / contrib / mmap.cc
index 593bb063b9d0746a946a483efbaefdc7f825f8ee..aaa9da44f2276672c7c1d05f32600e10294e41a4 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;
@@ -328,7 +338,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;
       }
    }