summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-02-15 11:21:31 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-02-15 11:21:31 +0100
commit87f8f68c50f63b39b7a91e3aec0b5ef59069186d (patch)
treeda23238b6ce9e63438b2e9290b4a383eb79d842a /apt-pkg/contrib/mmap.cc
parent8d009e3e8ac6c6431a8bc79a07d9ad7c0295d160 (diff)
parent1dfaf0bf650a78ddaf991bf3ad597fa4d101041f (diff)
merged from debian
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 4978446d2..9945b1606 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -106,7 +106,7 @@ bool MMap::Map(FileFd &Fd)
/* */
bool MMap::Close(bool DoSync)
{
- if ((Flags & UnMapped) == UnMapped || Base == 0 || iSize == 0)
+ if ((Flags & UnMapped) == UnMapped || validData() == false || iSize == 0)
return true;
if (DoSync == true)
@@ -266,7 +266,7 @@ DynamicMMap::~DynamicMMap()
{
if (Fd == 0)
{
- if (Base == 0)
+ if (validData() == false)
return;
#ifdef _POSIX_MAPPED_FILES
munmap(Base, WorkSpace);