mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 918140 - mis-interprets disk "hard quota" (blocks vs bytes confusion). r=benjamin
This commit is contained in:
parent
7ca0fddc23
commit
abb3ffd658
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user