summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorIshan Jayawardena <udeshike@gmail.com>2011-07-16 14:41:53 +0530
committerIshan Jayawardena <udeshike@gmail.com>2011-07-16 14:41:53 +0530
commit8a8ea4baa11f07e1de4cf190f82dbd79ff1affa5 (patch)
treef8710b0994c439f46e75c8f28af0f6b8251f380c /apt-pkg/pkgcachegen.cc
parent3efe86af099d5a5d05e2e61a571da864676834c7 (diff)
parent0df8c3dccbda739af6e20999fb208ada0619ad80 (diff)
fixed indentation issues
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 9820fde81..8f9737e26 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1169,16 +1169,32 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
SPtr<DynamicMMap> Map;
if (Writeable == true && CacheFile.empty() == false)
{
+ _error->PushToStack();
unlink(CacheFile.c_str());
CacheF = new FileFd(CacheFile,FileFd::WriteAtomic);
fchmod(CacheF->Fd(),0644);
Map = CreateDynamicMMap(CacheF, MMap::Public);
if (_error->PendingError() == true)
- return false;
- if (Debug == true)
+ {
+ delete CacheF.UnGuard();
+ delete Map.UnGuard();
+ if (Debug == true)
+ std::clog << "Open filebased MMap FAILED" << std::endl;
+ Writeable = false;
+ if (AllowMem == false)
+ {
+ _error->MergeWithStack();
+ return false;
+ }
+ _error->RevertToStack();
+ }
+ else if (Debug == true)
+ {
+ _error->MergeWithStack();
std::clog << "Open filebased MMap" << std::endl;
+ }
}
- else
+ if (Writeable == false || CacheFile.empty() == true)
{
// Just build it in memory..
Map = CreateDynamicMMap(NULL);