From 37254316e0b1c3b0c067cf1962d0882d70a38c12 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 12 Feb 2011 13:43:32 +0100 Subject: [PATCH] * methods/rred.cc: - read patch into MMap only if we work on uncompressed patches --- debian/changelog | 4 +++- methods/rred.cc | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2da3afa38..4f1a8afa4 100644 --- a/debian/changelog +++ b/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 Fri, 11 Feb 2011 17:44:49 +0100 + -- David Kalnischkies Sat, 12 Feb 2011 13:43:11 +0100 apt (0.8.11.1) unstable; urgency=low diff --git a/methods/rred.cc b/methods/rred.cc index 1a18a381c..80cd14986 100644 --- a/methods/rred.cc +++ b/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) -- 2.45.2