From e9fce64bd454e68641a265d384669217f2bc0558 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Sep 2007 19:23:55 +0200 Subject: [PATCH] * apt-pkg/acquire-item.cc: - fix crash in diff acquire code * apt-pkg/contrib/mmap.cc: - don't fail if msync() returns > 0 --- apt-pkg/acquire-item.cc | 2 +- apt-pkg/contrib/mmap.cc | 4 ++-- debian/changelog | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 32798335c..c38a50194 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -345,7 +345,7 @@ void pkgAcqDiffIndex::Done(string Message,unsigned long Size,string Md5Hash, */ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner, string URI,string URIDesc,string ShortDesc, - HashString ExpectedMD5, + HashString ExpecteHash, vector diffs) : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash), available_patches(diffs) 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 a271c6a6c..e1d166fdf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,8 @@ apt (0.7.7) UNRELEASED; urgency=low * cmdline/apt-get.cc: - do not change the auto-installed information if a package is reinstalled + * apt-pkg/acquire-item.cc: + - fix crash in diff acquire code * cmdline/apt-mark: - Fix chmoding after have renamed the extended-states file (LP: #140019) (thanks to Laurent Bigonville) @@ -41,6 +43,10 @@ apt (0.7.7) UNRELEASED; urgency=low [ Ian Jackson ] * dpkg-triggers: Deal properly with new package states. + [ Colin Watson ] + * apt-pkg/contrib/mmap.cc: + - don't fail if msync() returns > 0 + -- Michael Vogt Thu, 02 Aug 2007 11:55:54 +0200 apt (0.7.6) unstable; urgency=low -- 2.45.2