diff options
author | aristocratos <gnmjpl@gmail.com> | 2021-10-06 18:06:05 +0200 |
---|---|---|
committer | aristocratos <gnmjpl@gmail.com> | 2021-10-06 18:06:05 +0200 |
commit | d96fdd7eb2fcd60b48d4837908476deb027f7c9a (patch) | |
tree | f52959002f182ca469e905a35065db4c7f1f2265 | |
parent | 132f4e6da127281763d0a30e44d2bf7a9040936d (diff) |
Fixed: Extra "root" partition when running in snap
-rw-r--r-- | src/linux/btop_collect.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index ff72654..9ba9bcc 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -112,7 +112,7 @@ namespace Shared { clkTck = 100; Logger::warning("Could not get system clock ticks per second. Defaulting to 100, processes cpu usage might be incorrect."); } - + //? Init for namespace Cpu if (not fs::exists(Cpu::freq_path) or access(Cpu::freq_path.c_str(), R_OK) == -1) Cpu::freq_path.clear(); Cpu::current_cpu.core_percent.insert(Cpu::current_cpu.core_percent.begin(), Shared::coreCount, {}); @@ -675,7 +675,7 @@ namespace Mem { } if (not meminfo.good() or totalMem == 0) throw std::runtime_error("Could not get total memory size from /proc/meminfo"); - + return totalMem; } @@ -896,7 +896,11 @@ namespace Mem { disks.at("swap").free_percent = mem.percent.at("swap_free").back(); } for (const auto& name : last_found) - if (not is_in(name, "/", "swap")) mem.disks_order.push_back(name); + #ifdef SNAPPED + if (not is_in(name, "/mnt", "swap")) mem.disks_order.push_back(name); + #else + if (not is_in(name, "/", "swap")) mem.disks_order.push_back(name); + #endif //? Get disks IO int64_t sectors_read, sectors_write, io_ticks; |