diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-10-30 00:57:05 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-10-30 00:57:05 +0000 |
commit | 32d490313b21d5cea64f99ca9db4388591bb3ab9 (patch) | |
tree | a12fad3d9a06160b362c2d8b515f153b2e3ffa33 /main.cpp | |
parent | a0c17c03eb323ddec28e36cfc30174a58264cbcf (diff) |
make CheckDiskSpace portable
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@22 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -1398,21 +1398,15 @@ string GetAppDir() bool CheckDiskSpace(int64 nAdditionalBytes)
{
- uint64 nFreeBytesAvailable = 0; // bytes available to caller
- uint64 nTotalNumberOfBytes = 0; // bytes on disk
- uint64 nTotalNumberOfFreeBytes = 0; // free bytes on disk
-
- if (!GetDiskFreeSpaceEx(GetAppDir().c_str(),
- (PULARGE_INTEGER)&nFreeBytesAvailable,
- (PULARGE_INTEGER)&nTotalNumberOfBytes,
- (PULARGE_INTEGER)&nTotalNumberOfFreeBytes))
+ wxLongLong nFreeBytesAvailable = 0;
+ if (!wxGetDiskSpace(GetDataDir(), NULL, &nFreeBytesAvailable))
{
- printf("ERROR: GetDiskFreeSpaceEx() failed\n");
+ printf("ERROR: wxGetDiskSpace() failed\n");
return true;
}
// Check for 15MB because database could create another 10MB log file at any time
- if ((int64)nFreeBytesAvailable < 15000000 + nAdditionalBytes)
+ if (nFreeBytesAvailable < (int64)15000000 + nAdditionalBytes)
{
fShutdown = true;
wxMessageBox("Warning: Your disk space is low ", "Bitcoin", wxICON_EXCLAMATION);
|