Bläddra i källkod

* methods/rred.cc:
- read patch into MMap only if we work on uncompressed patches

David Kalnischkies 15 år sedan
förälder
incheckning
37254316e0
2 ändrade filer med 7 tillägg och 3 borttagningar
  1. 3 1
      debian/changelog
  2. 4 2
      methods/rred.cc

+ 3 - 1
debian/changelog

@@ -7,8 +7,10 @@ apt (0.8.12) unstable; urgency=low
     - mark a package which was requested to be installed on commandline
       always as manual regardless if it is already marked or not as the
       marker could be lost later by the removal of rdepends (Closes: #612557)
+  * methods/rred.cc:
+    - read patch into MMap only if we work on uncompressed patches
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 11 Feb 2011 17:44:49 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 12 Feb 2011 13:43:11 +0100
 
 apt (0.8.11.1) unstable; urgency=low
 

+ 4 - 2
methods/rred.cc

@@ -252,13 +252,15 @@ struct EdCommand {								/*{{{*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,		/*{{{*/
 					FileFd &out_file, Hashes *hash) const {
 #ifdef _POSIX_MAPPED_FILES
-	MMap ed_cmds(Patch, MMap::ReadOnly);
+	MMap ed_cmds(MMap::ReadOnly);
 	if (Patch.gzFd() != NULL) {
 		unsigned long mapSize = Patch.Size();
 		DynamicMMap dyn(0, mapSize, 0);
 		gzread(Patch.gzFd(), dyn.Data(), mapSize);
 		ed_cmds = dyn;
-	}
+	} else
+		ed_cmds = MMap(Patch, MMap::ReadOnly);
+
 	MMap in_file(From, MMap::ReadOnly);
 
 	if (ed_cmds.Size() == 0 || in_file.Size() == 0)