зеркало из https://github.com/mozilla/gecko-dev.git
Fix int64 support in GetDiskSpaceAvailable, BeOS only fix.
This commit is contained in:
Родитель
65c7d68141
Коммит
019ad9bd97
|
@ -424,34 +424,27 @@ nsresult nsFileSpec::Execute(const char* inArgs ) const
|
|||
PRUint64 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
PRUint64 int64;
|
||||
|
||||
LL_I2L(int64 , ULONG_MAX);
|
||||
|
||||
char curdir [MAXPATHLEN];
|
||||
if (!mPath || !*mPath)
|
||||
{
|
||||
(void) getcwd(curdir, MAXPATHLEN);
|
||||
if (!curdir)
|
||||
return int64; /* hope for the best as we did in cheddar */
|
||||
return ULONGLONG_MAX; /* hope for the best as we did in cheddar */
|
||||
}
|
||||
else
|
||||
sprintf(curdir, "%.200s", (const char*)mPath);
|
||||
|
||||
BEntry e(curdir);
|
||||
if(e.InitCheck() != B_OK)
|
||||
return int64; /* hope for the best as we did in cheddar */
|
||||
return ULONGLONG_MAX; /* hope for the best as we did in cheddar */
|
||||
entry_ref ref;
|
||||
e.GetRef(&ref);
|
||||
BVolume v(ref.device);
|
||||
|
||||
// HACK!!!
|
||||
LL_I2L(int64 , (v.FreeBytes() > (int64)(ULONG_MAX) ? ULONG_MAX : (int32)v.FreeBytes()));
|
||||
|
||||
#ifdef DEBUG_DISK_SPACE
|
||||
printf("DiskSpaceAvailable: %d bytes\n", space);
|
||||
#endif
|
||||
return int64;
|
||||
return v.FreeBytes();
|
||||
} // nsFileSpec::GetDiskSpace()
|
||||
|
||||
//========================================================================================
|
||||
|
|
Загрузка…
Ссылка в новой задаче