* apt-pkg/acquire-item.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 27 Sep 2007 17:23:55 +0000 (19:23 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 27 Sep 2007 17:23:55 +0000 (19:23 +0200)
  - fix crash in diff acquire code
* apt-pkg/contrib/mmap.cc:
  - don't fail if msync() returns > 0

apt-pkg/acquire-item.cc
apt-pkg/contrib/mmap.cc
debian/changelog

index 3279833..c38a501 100644 (file)
@@ -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<DiffInfo> diffs)
    : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash), 
      available_patches(diffs)
index 7f814c2..abcae46 100644 (file)
@@ -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;
index a271c6a..e1d166f 100644 (file)
@@ -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 <michael.vogt@ubuntu.com>  Thu, 02 Aug 2007 11:55:54 +0200
 
 apt (0.7.6) unstable; urgency=low