diff --git a/data.cpp b/data.cpp index 5b585b4..0b22f63 100755 --- a/data.cpp +++ b/data.cpp @@ -10,6 +10,7 @@ #include #include #include +#include class Space { public: @@ -281,7 +282,7 @@ void get_available_space(std::vector &space) { std::vector mounts; struct statfs stats; std::string fullname, name, mountpoint; - fsblkcnt_t free_space, total_space; + uint64_t free_blocks, total_blocks; int ptr, len; size_t str_pos; bool OK; @@ -346,11 +347,11 @@ void get_available_space(std::vector &space) { // figure out free and total space statfs(mountpoint.c_str(), &stats); - free_space = stats.f_bfree * stats.f_bsize; - total_space = stats.f_blocks * stats.f_bsize; + free_blocks = stats.f_bfree; + total_blocks = stats.f_blocks; // pass it on - space.push_back(Space(name.c_str(), free_space, total_space)); + space.push_back(Space(name.c_str(), free_blocks * stats.f_bsize, total_blocks * stats.f_bsize)); } } }