From 296e7f4b92edd2fe13c6caf689aaa29dc56b860f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 22 Sep 2007 21:38:43 +0100 Subject: [PATCH] * apt-pkg/contrib/mmap.cc: - don't fail if msync() returns > 0 (LP: #144001) --- apt-pkg/contrib/mmap.cc | 4 ++-- 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 Sat, 22 Sep 2007 21:21:19 +0100 + apt (0.7.6ubuntu10) gutsy; urgency=low * apt-pkg/deb/dpkgpm.cc: -- 2.45.2