Explorar o código

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

David Kalnischkies %!s(int64=15) %!d(string=hai) anos
pai
achega
37254316e0
Modificáronse 2 ficheiros con 7 adicións e 3 borrados
  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
     - mark a package which was requested to be installed on commandline
       always as manual regardless if it is already marked or not as the
       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)
       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
 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,		/*{{{*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,		/*{{{*/
 					FileFd &out_file, Hashes *hash) const {
 					FileFd &out_file, Hashes *hash) const {
 #ifdef _POSIX_MAPPED_FILES
 #ifdef _POSIX_MAPPED_FILES
-	MMap ed_cmds(Patch, MMap::ReadOnly);
+	MMap ed_cmds(MMap::ReadOnly);
 	if (Patch.gzFd() != NULL) {
 	if (Patch.gzFd() != NULL) {
 		unsigned long mapSize = Patch.Size();
 		unsigned long mapSize = Patch.Size();
 		DynamicMMap dyn(0, mapSize, 0);
 		DynamicMMap dyn(0, mapSize, 0);
 		gzread(Patch.gzFd(), dyn.Data(), mapSize);
 		gzread(Patch.gzFd(), dyn.Data(), mapSize);
 		ed_cmds = dyn;
 		ed_cmds = dyn;
-	}
+	} else
+		ed_cmds = MMap(Patch, MMap::ReadOnly);
+
 	MMap in_file(From, MMap::ReadOnly);
 	MMap in_file(From, MMap::ReadOnly);
 
 
 	if (ed_cmds.Size() == 0 || in_file.Size() == 0)
 	if (ed_cmds.Size() == 0 || in_file.Size() == 0)