Fix int64 support in GetDiskSpaceAvailable, BeOS only fix.

This commit is contained in:
duncan%be.com 1999-09-10 12:39:08 +00:00
Родитель 65c7d68141
Коммит 019ad9bd97
1 изменённых файлов: 3 добавлений и 10 удалений

Просмотреть файл

@ -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()
//========================================================================================