Merge pull request #6239 from Icinga/fix/windows-check-memory

Fix Windows check_memory rounding
This commit is contained in:
Jean Flach 2018-05-04 16:38:21 +02:00 committed by GitHub
commit 303d9c61c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -203,8 +203,8 @@ static int check_memory(printInfoStruct& printInfo)
memBuf.dwLength = sizeof(memBuf);
GlobalMemoryStatusEx(&memBuf);
printInfo.tRam = round(memBuf.ullTotalPhys / pow(1024.0, printInfo.unit));
printInfo.aRam = round(memBuf.ullAvailPhys / pow(1024.0, printInfo.unit));
printInfo.tRam = round((memBuf.ullTotalPhys / pow(1024.0, printInfo.unit) * pow(10.0, printInfo.unit))) / pow(10.0, printInfo.unit);
printInfo.aRam = round((memBuf.ullAvailPhys / pow(1024.0, printInfo.unit) * pow(10.0, printInfo.unit))) / pow(10.0, printInfo.unit);
printInfo.percentFree = 100.0 * memBuf.ullAvailPhys / memBuf.ullTotalPhys;
if (l_Debug)