diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:38 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:38 +0000 |
commit | 67ff87bf72a9f6315020c0cd74632631c834ce1b (patch) | |
tree | 277f5310d4a3312748ea874a1977f8c4c1629974 /apt-pkg/pkgcachegen.cc | |
parent | 7ef724464cfe431862e0731327a3a131505fa38d (diff) |
More Fixes
Author: jgg
Date: 2000-01-14 06:26:36 GMT
More Fixes
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 404ef652a..c3cddd615 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcachegen.cc,v 1.44 2000/01/10 03:44:54 jgg Exp $ +// $Id: pkgcachegen.cc,v 1.45 2000/01/14 06:26:36 jgg Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -747,6 +747,10 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress) { string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache"); FileFd SCacheF(SCacheFile,FileFd::WriteEmpty); + + /* Open the pkgcache, we want a new inode here so we do no corrupt + existing mmaps */ + unlink(CacheFile.c_str()); FileFd CacheF(CacheFile,FileFd::WriteEmpty); DynamicMMap Map(CacheF,MMap::Public,MapSize); if (_error->PendingError() == true) @@ -776,8 +780,11 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress) // We use the source cache to generate the package cache string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache"); - FileFd SCacheF(SCacheFile,FileFd::ReadOnly); + + /* Open the pkgcache, we want a new inode here so we do no corrupt + existing mmaps */ + unlink(CacheFile.c_str()); FileFd CacheF(CacheFile,FileFd::WriteEmpty); DynamicMMap Map(CacheF,MMap::Public,MapSize); if (_error->PendingError() == true) |