From 8db8b9edacdc4118adfcf0e1982ad5047db9b7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 20 Dec 2020 18:21:25 +0100 Subject: [PATCH] DragonFlyBSD update - drop unused kinfo includes and link argument - detect kvm library necessity at configure step - fix variable typo --- Makefile.am | 7 ++++--- configure.ac | 4 ++++ dragonflybsd/DragonFlyBSDProcessList.c | 2 +- dragonflybsd/DragonFlyBSDProcessList.h | 2 -- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 80527829..fe70eef1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -192,9 +192,10 @@ dragonflybsd_platform_headers = \ dragonflybsd/ProcessField.h if HTOP_DRAGONFLYBSD -AM_LDFLAGS += -lkvm -lkinfo -myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \ -dragonflybsd/DragonFlyBSDProcess.c +myhtopplatsources = \ + dragonflybsd/Platform.c \ + dragonflybsd/DragonFlyBSDProcessList.c \ + dragonflybsd/DragonFlyBSDProcess.c myhtopplatheaders = $(dragonflybsd_platform_headers) endif diff --git a/configure.ac b/configure.ac index f303ff03..8b68c8e9 100644 --- a/configure.ac +++ b/configure.ac @@ -247,6 +247,10 @@ if test "$my_htop_platform" = "darwin"; then AC_CHECK_FUNCS([mach_timebase_info]) fi +if test "$my_htop_platform" = "dragonflybsd"; then + AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"]) +fi + if test "$my_htop_platform" = "freebsd"; then AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"]) fi diff --git a/dragonflybsd/DragonFlyBSDProcessList.c b/dragonflybsd/DragonFlyBSDProcessList.c index fd19df30..07fceefa 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.c +++ b/dragonflybsd/DragonFlyBSDProcessList.c @@ -431,7 +431,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { } proc->m_virt = kproc->kp_vm_map_size / ONE_K; - proc->m_resident = kproc->kp_vm_rssize * pageSizeKB; + proc->m_resident = kproc->kp_vm_rssize * pageSizeKb; proc->nlwp = kproc->kp_nthreads; // number of lwp thread proc->time = (kproc->kp_swtime + 5000) / 10000; diff --git a/dragonflybsd/DragonFlyBSDProcessList.h b/dragonflybsd/DragonFlyBSDProcessList.h index 682971e9..f2c7ce70 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.h +++ b/dragonflybsd/DragonFlyBSDProcessList.h @@ -11,8 +11,6 @@ in the source distribution for its full text. #include #include #include -#include -#include #include #include #include