Explorar el Código

* apt-pkg/acquire-item.cc:
- fix crash in diff acquire code
* apt-pkg/contrib/mmap.cc:
- don't fail if msync() returns > 0

Michael Vogt hace 19 años
padre
commit
e9fce64bd4
Se han modificado 3 ficheros con 9 adiciones y 3 borrados
  1. 1 1
      apt-pkg/acquire-item.cc
  2. 2 2
      apt-pkg/contrib/mmap.cc
  3. 6 0
      debian/changelog

+ 1 - 1
apt-pkg/acquire-item.cc

@@ -345,7 +345,7 @@ void pkgAcqDiffIndex::Done(string Message,unsigned long Size,string Md5Hash,
  */
  */
 pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
 pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
 				   string URI,string URIDesc,string ShortDesc,
 				   string URI,string URIDesc,string ShortDesc,
-				   HashString ExpectedMD5, 
+				   HashString ExpecteHash, 
 				   vector<DiffInfo> diffs)
 				   vector<DiffInfo> diffs)
    : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash), 
    : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash), 
      available_patches(diffs)
      available_patches(diffs)

+ 2 - 2
apt-pkg/contrib/mmap.cc

@@ -117,7 +117,7 @@ bool MMap::Sync()
    
    
 #ifdef _POSIX_SYNCHRONIZED_IO   
 #ifdef _POSIX_SYNCHRONIZED_IO   
    if ((Flags & ReadOnly) != ReadOnly)
    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");
 	 return _error->Errno("msync","Unable to write mmap");
 #endif   
 #endif   
    return true;
    return true;
@@ -134,7 +134,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop)
 #ifdef _POSIX_SYNCHRONIZED_IO
 #ifdef _POSIX_SYNCHRONIZED_IO
    unsigned long PSize = sysconf(_SC_PAGESIZE);
    unsigned long PSize = sysconf(_SC_PAGESIZE);
    if ((Flags & ReadOnly) != ReadOnly)
    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");
 	 return _error->Errno("msync","Unable to write mmap");
 #endif   
 #endif   
    return true;
    return true;

+ 6 - 0
debian/changelog

@@ -34,6 +34,8 @@ apt (0.7.7) UNRELEASED; urgency=low
   * cmdline/apt-get.cc:
   * cmdline/apt-get.cc:
     - do not change the auto-installed information if a package
     - do not change the auto-installed information if a package
       is reinstalled
       is reinstalled
+  * apt-pkg/acquire-item.cc:
+    - fix crash in diff acquire code
   * cmdline/apt-mark:
   * cmdline/apt-mark:
     - Fix chmoding after have renamed the extended-states file (LP: #140019)
     - Fix chmoding after have renamed the extended-states file (LP: #140019)
       (thanks to Laurent Bigonville)
       (thanks to Laurent Bigonville)
@@ -41,6 +43,10 @@ apt (0.7.7) UNRELEASED; urgency=low
   [ Ian Jackson ]
   [ Ian Jackson ]
   * dpkg-triggers: Deal properly with new package states.
   * 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
  -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 02 Aug 2007 11:55:54 +0200
 
 
 apt (0.7.6) unstable; urgency=low
 apt (0.7.6) unstable; urgency=low