nsFileSpec::GetDiskSpace now returns a PRUint64. (12479)
thanks to Chet Murphy <cmurphy@modelworks.com> for the windows code! git-svn-id: svn://10.0.0.236/trunk@46590 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -474,9 +474,11 @@ nsresult nsFileSpec::Execute(const char* inArgs ) const
|
||||
} // nsFileSpec::Execute
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRUint32 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
PRUint64 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
PRUint64 int64;
|
||||
LL_I2L(int64 , ULONG_MAX);
|
||||
|
||||
#if defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_STATVFS_H)
|
||||
|
||||
@@ -485,7 +487,7 @@ PRUint32 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
{
|
||||
(void) getcwd(curdir, MAXPATHLEN);
|
||||
if (!curdir)
|
||||
return ULONG_MAX; /* hope for the best as we did in cheddar */
|
||||
return int64; /* hope for the best as we did in cheddar */
|
||||
}
|
||||
else
|
||||
sprintf(curdir, "%.200s", (const char*)mPath);
|
||||
@@ -496,21 +498,22 @@ PRUint32 nsFileSpec::GetDiskSpaceAvailable() const
|
||||
#else
|
||||
if (STATFS(curdir, &fs_buf) < 0)
|
||||
#endif
|
||||
return ULONG_MAX; /* hope for the best as we did in cheddar */
|
||||
return int64; /* hope for the best as we did in cheddar */
|
||||
|
||||
#ifdef DEBUG_DISK_SPACE
|
||||
printf("DiskSpaceAvailable: %d bytes\n",
|
||||
fs_buf.f_bsize * (fs_buf.f_bavail - 1));
|
||||
#endif
|
||||
|
||||
return fs_buf.f_bsize * (fs_buf.f_bavail - 1);
|
||||
LL_I2L( int64 , (fs_buf.f_bsize * (fs_buf.f_bavail - 1) ) );
|
||||
return int64
|
||||
|
||||
#else
|
||||
/*
|
||||
** This platform doesn't have statfs or statvfs, so we don't have much
|
||||
** choice but to "hope for the best as we did in cheddar".
|
||||
*/
|
||||
return ULONG_MAX;
|
||||
return int64;
|
||||
#endif /* HAVE_SYS_STATFS_H or HAVE_SYS_STATVFS_H */
|
||||
|
||||
} // nsFileSpec::GetDiskSpace()
|
||||
|
||||
Reference in New Issue
Block a user