зеркало из https://github.com/microsoft/SCXcore.git
Fixes PercentUsedSpace,PercentFreeSpace to be same with df command. (#10)
This commit is contained in:
Родитель
803cd18e29
Коммит
59061ce0ba
|
@ -105,10 +105,11 @@ static void EnumerateOneInstance(
|
|||
inst.UsedMegabytes_value(data1);
|
||||
unsigned char freeSpace = 100;
|
||||
unsigned char usedSpace = 0;
|
||||
if (0 < data1+data2)
|
||||
scxulong totalData = data1 + data2;
|
||||
if (0 < totalData)
|
||||
{
|
||||
freeSpace = (unsigned char) SCXCoreLib::GetPercentage(0, data2, 0, data3);
|
||||
usedSpace = (unsigned char) SCXCoreLib::GetPercentage(0, data1, 0, data3);
|
||||
freeSpace = (unsigned char) SCXCoreLib::GetPercentage(0, data2, 0, totalData);
|
||||
usedSpace = (unsigned char) SCXCoreLib::GetPercentage(0, data1, 0, totalData);
|
||||
}
|
||||
inst.PercentFreeSpace_value(freeSpace);
|
||||
inst.PercentUsedSpace_value(usedSpace);
|
||||
|
|
Загрузка…
Ссылка в новой задаче