]> git.treefish.org Git - phys/latlib.git/blobdiff - configcache.cpp
...
[phys/latlib.git] / configcache.cpp
index af0a206eb6c73ea126b392395ad1472f0b4d882a..556dba720c6465460e3f0df6cb249b2afc6d3b6b 100644 (file)
@@ -107,6 +107,7 @@ bool configcache::readConfig()
        {
          if(out) *out->log << "CCACHE: Opening dat-file: " << inFiles.back() << endl << flush;
 
        {
          if(out) *out->log << "CCACHE: Opening dat-file: " << inFiles.back() << endl << flush;
 
+         openFileName = inFiles.back();
          inFile.open( (DATADIR + "/" + inFiles.back()).c_str(), std::ios::binary );
          inFiles.pop_back();
 
          inFile.open( (DATADIR + "/" + inFiles.back()).c_str(), std::ios::binary );
          inFiles.pop_back();
 
@@ -115,7 +116,7 @@ bool configcache::readConfig()
          std::streampos fsize = inFile.tellg();
           inFile.seekg( 0, std::ios::end );
           fsize = inFile.tellg() - fsize;
          std::streampos fsize = inFile.tellg();
           inFile.seekg( 0, std::ios::end );
           fsize = inFile.tellg() - fsize;
-         if( fsize == 0 ) {
+         if( (int)fsize == 0 ) {
            *out->log << "CCACHE: dat-file has zero length! Skipping." << endl << flush;
            inFile.close();
            continue;
            *out->log << "CCACHE: dat-file has zero length! Skipping." << endl << flush;
            inFile.close();
            continue;
@@ -141,7 +142,10 @@ bool configcache::readConfig()
              memcpy(configMem, tmpConfig, configSize);
              return true;
            }
              memcpy(configMem, tmpConfig, configSize);
              return true;
            }
-         else inFile.close(); 
+         else {
+           *out->log << "CCACHE: Closing dat-file: " << openFileName << endl << flush;
+           inFile.close();
+         }
        }
     }
 }
        }
     }
 }