bug 71393, miscalculates free space on large drives. Contributed by thorgal@amiga.com.pl and bzbarsky@mit.edu, r=ksosez@softhome.net/dveditz@netscape.com

This commit is contained in:
dveditz%netscape.com 2001-04-18 04:30:26 +00:00
parent 0c9834b8c7
commit 184c59ebaf
2 changed files with 8 additions and 2 deletions

View File

@ -529,7 +529,10 @@ PRInt64 nsFileSpec::GetDiskSpaceAvailable() const
fs_buf.f_bsize * (fs_buf.f_bavail - 1));
#endif
LL_I2L( bytes, (fs_buf.f_bsize * (fs_buf.f_bavail - 1) ) );
PRInt64 bsize,bavail;
LL_I2L( bsize, fs_buf.f_bsize );
LL_I2L( bavail, fs_buf.f_bavail - 1 );
LL_MUL( *aDiskSpaceAvailable, bsize, bavail );
return bytes;
#else

View File

@ -1005,7 +1005,10 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
// a non-superuser, minus one as a fudge factor, multiplied by the size
// of the beforementioned blocks.
LL_I2L(*aDiskSpaceAvailable, fs_buf.f_bsize * (fs_buf.f_bavail - 1));
PRInt64 bsize,bavail;
LL_I2L( bsize, fs_buf.f_bsize );
LL_I2L( bavail, fs_buf.f_bavail - 1 );
LL_MUL( *aDiskSpaceAvailable, bsize, bavail );
return NS_OK;
#else