Bug 981348 - OS.File: f_bavail uses f_frsize units according to POSIX. r=Yoric

MozReview-Commit-ID: GU7CbhSsvTa

--HG--
extra : rebase_source : 3111b06d582a2ed0fbf9194c43a438c51751df38
This commit is contained in:
Jan Beich 2014-03-08 19:30:00 -08:00
Родитель a93cff3659
Коммит cc6d16c6b6
3 изменённых файлов: 4 добавлений и 4 удалений

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

@ -699,7 +699,7 @@ static const dom::ConstantSpec gLibcProperties[] =
{ "OSFILE_SIZEOF_STATVFS", JS::Int32Value(sizeof (struct statvfs)) },
{ "OSFILE_OFFSETOF_STATVFS_F_BSIZE", JS::Int32Value(offsetof (struct statvfs, f_bsize)) },
{ "OSFILE_OFFSETOF_STATVFS_F_FRSIZE", JS::Int32Value(offsetof (struct statvfs, f_frsize)) },
{ "OSFILE_OFFSETOF_STATVFS_F_BAVAIL", JS::Int32Value(offsetof (struct statvfs, f_bavail)) },
#endif // defined(XP_UNIX)

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

@ -228,8 +228,8 @@
let statvfs = new SharedAll.HollowStructure("statvfs",
Const.OSFILE_SIZEOF_STATVFS);
statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BSIZE,
"f_bsize", Type.unsigned_long.implementation);
statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_FRSIZE,
"f_frsize", Type.unsigned_long.implementation);
statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BAVAIL,
"f_bavail", Type.fsblkcnt_t.implementation);

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

@ -399,7 +399,7 @@
throw_on_negative("statvfs", (UnixFile.statvfs || UnixFile.statfs)(sourcePath, fileSystemInfoPtr));
let bytes = new Type.uint64_t.implementation(
fileSystemInfo.f_bsize * fileSystemInfo.f_bavail);
fileSystemInfo.f_frsize * fileSystemInfo.f_bavail);
return bytes.value;
};