diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-03-27 11:38:26 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-03-27 11:38:34 +0100 |
| commit | ebb783a9f2acd0992a5497deb4953271ebfa4726 (patch) | |
| tree | 8b3274cad2a12b92864f35538529c00813cc22b8 /src/util.cpp | |
| parent | Merge pull request #3682 (diff) | |
| parent | replace custom GetFilesize() with boost::filesystem::file_size() (diff) | |
| download | discoin-ebb783a9f2acd0992a5497deb4953271ebfa4726.tar.xz discoin-ebb783a9f2acd0992a5497deb4953271ebfa4726.zip | |
Merge pull request #3603
a486abd replace custom GetFilesize() with boost::filesystem::file_size() (Philip Kaufmann)
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/util.cpp b/src/util.cpp index 36dfd8ab7..b90921ab8 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1107,16 +1107,6 @@ void FileCommit(FILE *fileout) #endif } -int GetFilesize(FILE* file) -{ - int nSavePos = ftell(file); - int nFilesize = -1; - if (fseek(file, 0, SEEK_END) == 0) - nFilesize = ftell(file); - fseek(file, nSavePos, SEEK_SET); - return nFilesize; -} - bool TruncateFile(FILE *file, unsigned int length) { #if defined(WIN32) return _chsize(_fileno(file), length) == 0; @@ -1195,7 +1185,7 @@ void ShrinkDebugFile() // Scroll debug.log if it's getting too big boost::filesystem::path pathLog = GetDataDir() / "debug.log"; FILE* file = fopen(pathLog.string().c_str(), "r"); - if (file && GetFilesize(file) > 10 * 1000000) + if (file && boost::filesystem::file_size(pathLog) > 10 * 1000000) { // Restart the file with some of the end char pch[200000]; @@ -1214,13 +1204,6 @@ void ShrinkDebugFile() fclose(file); } - - - - - - - // // "Never go to sea with two chronometers; take one or three." // Our three time sources are: |