summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.cc
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-01-30 09:43:43 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2017-01-30 09:43:43 -0800
commitf932bccbf7f8e8c06cb978e9a9b722d1b583c358 (patch)
tree2e4d9e8f1643a25c09b22991436ed74087179566 /apt-pkg/contrib/mmap.cc
parent0b23d3c0a7a116a19c14ae63b6281464ba1382a4 (diff)
Bill is consistent. Bill is correct. Be like Bill.
Diffstat (limited to 'apt-pkg/contrib/mmap.cc')
-rw-r--r--apt-pkg/contrib/mmap.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index f632cd6c5..8fbddbd2f 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -106,14 +106,14 @@ bool MMap::Map(FileFd &Fd)
if (unlikely(Base == nullptr))
return _error->Errno("MMap-malloc", _("Couldn't make mmap of %llu bytes"), iSize);
SyncToFd = new FileFd();
- return Fd.Read(Base, iSize);
+ return Fd.Seek(0L) && Fd.Read(Base, iSize);
}
// FIXME: Writing to compressed fd's ?
int const dupped_fd = dup(Fd.Fd());
if (dupped_fd == -1)
return _error->Errno("mmap", _("Couldn't duplicate file descriptor %i"), Fd.Fd());
- Base = calloc(iSize, 1);
+ Base = malloc(iSize);
if (unlikely(Base == nullptr))
return _error->Errno("MMap-calloc", _("Couldn't make mmap of %llu bytes"), iSize);
SyncToFd = new FileFd (dupped_fd);