Skip to content

Commit

Permalink
Attempt to fix the CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
fraggerfox committed Feb 24, 2024
1 parent a50f2ad commit 637aeb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/continuous-build-netbsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/netbsd/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;

Expand Down

0 comments on commit 637aeb3

Please sign in to comment.