diff options
author | Colin Watson <cjwatson@canonical.com> | 2007-09-22 21:38:43 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@canonical.com> | 2007-09-22 21:38:43 +0100 |
commit | 296e7f4b92edd2fe13c6caf689aaa29dc56b860f (patch) | |
tree | 67d335b6d63c8d4fa632adf819afdaf285d866f0 | |
parent | c9034b42ab8da606fc0214dbad54025fc4b586af (diff) |
* apt-pkg/contrib/mmap.cc:
- don't fail if msync() returns > 0 (LP: #144001)
-rw-r--r-- | apt-pkg/contrib/mmap.cc | 4 | ||||
-rw-r--r-- | debian/changelog | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 7f814c2d2..abcae46fe 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -117,7 +117,7 @@ bool MMap::Sync() #ifdef _POSIX_SYNCHRONIZED_IO if ((Flags & ReadOnly) != ReadOnly) - if (msync((char *)Base,iSize,MS_SYNC) != 0) + if (msync((char *)Base,iSize,MS_SYNC) < 0) return _error->Errno("msync","Unable to write mmap"); #endif return true; @@ -134,7 +134,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) #ifdef _POSIX_SYNCHRONIZED_IO unsigned long PSize = sysconf(_SC_PAGESIZE); if ((Flags & ReadOnly) != ReadOnly) - if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) != 0) + if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) < 0) return _error->Errno("msync","Unable to write mmap"); #endif return true; diff --git a/debian/changelog b/debian/changelog index effaed1f7..60fce3015 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +apt (0.7.6ubuntu11) UNRELEASED; urgency=low + + * apt-pkg/contrib/mmap.cc: + - don't fail if msync() returns > 0 (LP: #144001) + + -- Colin Watson <cjwatson@ubuntu.com> Sat, 22 Sep 2007 21:21:19 +0100 + apt (0.7.6ubuntu10) gutsy; urgency=low * apt-pkg/deb/dpkgpm.cc: |