aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <[email protected]>2014-01-30 10:55:55 +0100
committerlangerhans <[email protected]>2014-06-29 16:00:10 +0200
commitea4d67f3dc87e0e7a1872bd5b5b15e0cac224fd5 (patch)
tree6fee21a6493f8e476b0023da2a90f16e8f8d576d /src/util.cpp
parentrpc: keep track of acceptors (diff)
downloaddiscoin-ea4d67f3dc87e0e7a1872bd5b5b15e0cac224fd5.tar.xz
discoin-ea4d67f3dc87e0e7a1872bd5b5b15e0cac224fd5.zip
replace custom GetFilesize() with boost::filesystem::file_size()
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/util.cpp b/src/util.cpp
index adcdbe8fd..f8eb9a658 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1090,16 +1090,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;
@@ -1178,7 +1168,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];
@@ -1197,13 +1187,6 @@ void ShrinkDebugFile()
fclose(file);
}
-
-
-
-
-
-
-
//
// "Never go to sea with two chronometers; take one or three."
// Our three time sources are: