summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2007-09-22 21:38:43 +0100
committerColin Watson <cjwatson@canonical.com>2007-09-22 21:38:43 +0100
commit296e7f4b92edd2fe13c6caf689aaa29dc56b860f (patch)
tree67d335b6d63c8d4fa632adf819afdaf285d866f0 /apt-pkg
parentc9034b42ab8da606fc0214dbad54025fc4b586af (diff)
* apt-pkg/contrib/mmap.cc:
- don't fail if msync() returns > 0 (LP: #144001)
Diffstat (limited to 'apt-pkg')
-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 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;