summaryrefslogtreecommitdiff
path: root/methods/rred.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-02-12 13:43:32 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-02-12 13:43:32 +0100
commit37254316e0b1c3b0c067cf1962d0882d70a38c12 (patch)
treeb0cf0ee36cd3b61920ea5a2039fb33bab6a32ec6 /methods/rred.cc
parentfdbe726599ae4dd3d808858356cf3464de94f1e4 (diff)
* methods/rred.cc:
- read patch into MMap only if we work on uncompressed patches
Diffstat (limited to 'methods/rred.cc')
-rw-r--r--methods/rred.cc6
1 files changed, 4 insertions, 2 deletions
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)