fix(fs): Calculate free bytes properly

Seems this was missed in a682d2af91

This is now also consistent with what df does

Closes #743
This commit is contained in:
patrick96 2019-01-17 00:05:36 +01:00 committed by Patrick Ziegler
parent 67f1ceaaca
commit a0b888b5e6
2 changed files with 5 additions and 5 deletions

View File

@ -17,10 +17,10 @@ namespace modules {
string type;
string fsname;
unsigned long long bytes_free{0ULL};
unsigned long long bytes_used{0ULL};
unsigned long long bytes_avail{0ULL};
unsigned long long bytes_total{0ULL};
uint64_t bytes_free{0ULL};
uint64_t bytes_used{0ULL};
uint64_t bytes_avail{0ULL};
uint64_t bytes_total{0ULL};
int percentage_free{0};
int percentage_used{0};

View File

@ -98,7 +98,7 @@ namespace modules {
// see: http://en.cppreference.com/w/cpp/filesystem/space
mount->bytes_total = buffer.f_frsize * buffer.f_blocks;
mount->bytes_free = buffer.f_bsize * buffer.f_bfree;
mount->bytes_free = buffer.f_frsize * buffer.f_bfree;
mount->bytes_used = mount->bytes_total - mount->bytes_free;
mount->bytes_avail = buffer.f_frsize * buffer.f_bavail;