summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-08 13:41:21 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-08 13:41:21 +0200
commit12704e53a8847bba40077340ce4faced53e37b73 (patch)
treef5437966b9e4871b2cbfa9f471c9b2dccefdf1a9
parentc6e9cc582c7093b08c7c057c1f7885eb07e06959 (diff)
parent2af2eb53e867bfcc0422aaf3c93c79eb2c93e9cc (diff)
Merge remote-tracking branch 'upstream/debian/sid' into bugfix/update-progress-reporting
-rw-r--r--ftparchive/cachedb.cc18
1 files changed, 4 insertions, 14 deletions
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index d589c4c5a..e56deae1e 100644
--- a/ftparchive/cachedb.cc
+++ b/ftparchive/cachedb.cc
@@ -97,13 +97,8 @@ bool CacheDB::ReadyDB(std::string const &DB)
/* */
bool CacheDB::OpenFile()
{
- // its open already
- if(Fd && Fd->Name() == this->FileName)
- return true;
-
- // a different file is open, close it first
- if(Fd && Fd->Name() != this->FileName)
- CloseFile();
+ // always close existing file first
+ CloseFile();
// open a new file
Fd = new FileFd(FileName,FileFd::ReadOnly);
@@ -128,13 +123,8 @@ void CacheDB::CloseFile()
// CacheDB::OpenDebFile - Open a debfile /*{{{*/
bool CacheDB::OpenDebFile()
{
- // debfile is already open
- if(DebFile && &DebFile->GetFile() == Fd)
- return true;
-
- // a different debfile is open, close it first
- if(DebFile && &DebFile->GetFile() != Fd)
- CloseDebFile();
+ // always close existing file first
+ CloseDebFile();
// first open the fd, then pass it to the debDebFile
if(OpenFile() == false)