зеркало из https://github.com/mozilla/gecko-dev.git
Bug 918140 - mis-interprets disk "hard quota" (blocks vs bytes confusion). r=benjamin
This commit is contained in:
Родитель
2c8a202b70
Коммит
bb28658a19
|
@ -11,6 +11,7 @@
|
|||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include <sys/mount.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
@ -1407,10 +1408,9 @@ nsLocalFile::GetDiskSpaceAvailable(int64_t* aDiskSpaceAvailable)
|
|||
#endif
|
||||
&& dq.dqb_bhardlimit) {
|
||||
int64_t QuotaSpaceAvailable = 0;
|
||||
if (dq.dqb_bhardlimit > dq.dqb_curspace) {
|
||||
QuotaSpaceAvailable =
|
||||
int64_t(fs_buf.F_BSIZE * (dq.dqb_bhardlimit - dq.dqb_curspace));
|
||||
}
|
||||
// dqb_bhardlimit is count of BLOCK_SIZE blocks, dqb_curspace is bytes
|
||||
if ((BLOCK_SIZE * dq.dqb_bhardlimit) > dq.dqb_curspace)
|
||||
QuotaSpaceAvailable = int64_t(BLOCK_SIZE * dq.dqb_bhardlimit - dq.dqb_curspace);
|
||||
if (QuotaSpaceAvailable < *aDiskSpaceAvailable) {
|
||||
*aDiskSpaceAvailable = QuotaSpaceAvailable;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче