From 637aeb3ff4f43e26e898d22dd30d897b0313d8a5 Mon Sep 17 00:00:00 2001 From: Santhosh Raju Date: Thu, 22 Feb 2024 17:54:07 +0100 Subject: [PATCH] Attempt to fix the CI. --- .github/workflows/continuous-build-netbsd.yml | 9 ++++----- src/netbsd/btop_collect.cpp | 7 +++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-build-netbsd.yml b/.github/workflows/continuous-build-netbsd.yml index b725b7289..30fbb9724 100755 --- a/.github/workflows/continuous-build-netbsd.yml +++ b/.github/workflows/continuous-build-netbsd.yml @@ -46,14 +46,13 @@ jobs: usesh: true prepare: | PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH" - PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages" - PKG_PATH="$PKG_PATH/NetBSD/amd64/9.3/All/" + PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/9.3/All/" export PATH PKG_PATH - pkg_add pkgin - pkgin install -y gmake gcc-10 coreutils git + /usr/sbin/pkg_add pkgin + pkgin -y install gmake gcc10 coreutils git git config --global --add safe.directory /home/runner/work/btop/btop run: | - gmake CXX=/usr/pkg/gcc10/bin/g++ STATIC=true STRIP=true + gmake CXX=/usr/pkg/gcc10/bin/g++ CXXFLAGS='-DNDEBUG -I/usr/pkg/gcc10/include -I/usr/include -I/usr/pkg/include' LDFLAGS=' -L/usr/pkg/gcc10/lib -R/usr/pkg/gcc10/lib -L/usr/pkg/gcc10/lib/gcc/x86_64--netbsd/10.5.0 -Wl,-R/usr/pkg/gcc10/lib/gcc/x86_64--netbsd/10.5.0 -Wl,-zrelro -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib' STATIC=true STRIP=true GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") mv bin/btop bin/btop-GCC10-"$GIT_HASH" ls -alh bin diff --git a/src/netbsd/btop_collect.cpp b/src/netbsd/btop_collect.cpp index 69c125cfe..c18abe25e 100644 --- a/src/netbsd/btop_collect.cpp +++ b/src/netbsd/btop_collect.cpp @@ -598,7 +598,7 @@ namespace Mem { auto &mem = current_mem; static bool snapped = (getenv("BTOP_SNAPPED") != nullptr); - uint64_t memActive, memWired, memCached, memFree, memInactive; + uint64_t memActive, memWired, memCached, memFree; size_t size; static int uvmexp_mib[] = {CTL_VM, VM_UVMEXP2}; @@ -609,13 +609,12 @@ namespace Mem { bzero(&uvmexp, sizeof(uvmexp)); } - memActive = (uvmexp.active + uvmexp.bootpages) * Shared::pageSize; + memActive = uvmexp.active * Shared::pageSize; memWired = uvmexp.wired * Shared::pageSize; - memInactive = uvmexp.inactive * Shared::pageSize; memFree = uvmexp.free * Shared::pageSize; memCached = (uvmexp.filepages + uvmexp.execpages + uvmexp.anonpages) * Shared::pageSize; mem.stats.at("used") = memActive + memWired; - mem.stats.at("available") = memInactive + memCached; + mem.stats.at("available") = Shared::totalMem - (memActive + memWired); mem.stats.at("cached") = memCached; mem.stats.at("free") = memFree;