summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-09-27 19:23:55 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-09-27 19:23:55 +0200
commite9fce64bd454e68641a265d384669217f2bc0558 (patch)
treece363405a65f6d2f8f7a49dfd3f01745bf4ddd5c /apt-pkg/contrib
parent526d43695b00573dcd8d323348a6b30d5215540b (diff)
* apt-pkg/acquire-item.cc:
- fix crash in diff acquire code * apt-pkg/contrib/mmap.cc: - don't fail if msync() returns > 0
Diffstat (limited to 'apt-pkg/contrib')
-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;