]> git.saurik.com Git - apt.git/commitdiff
* 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 32798335c8fc707c83bdc7b43b9a9c3f6bad97dd..c38a501941bb24630195847aab32259f21e01d36 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 7f814c2d2a9b1e13c38e19e9c1d85aa2b64e6366..abcae46feee411e0beb7b7bd97a057bf7264ff7a 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 a271c6a6cc0e10e657e260711a957b54cffae051..e1d166fdf581b8d16ebeead2cf5af589ab4272e4 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