From a707213aa1f6c635af1fb69bd7f5c06eca29a25d Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Tue, 11 Jan 2022 10:58:59 +0100 Subject: [PATCH] BUILD(client): Plugin framework: Use correct struct kinfo_proc members on NetBSD/OpenBSD `struct kinfo_proc` members are prefixed with `p_` in OpenBSD (http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/sysctl.h?annotate=1.220) and NetBSD (cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/sysctl.h?annotate=1.236) FreeBSD (https://cgit.freebsd.org/src/tree/sys/sys/user.h?id=01cad731921bb60b4f6e04c1cac987eea7af9d08#n121)and presumably Linux (I did not check) use the `ki_` prefix. Build-tested on OpenBSD 7.0-CURRENT. --- src/ProcessResolver.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ProcessResolver.cpp b/src/ProcessResolver.cpp index 631cba2fa1a..93559803404 100644 --- a/src/ProcessResolver.cpp +++ b/src/ProcessResolver.cpp @@ -267,7 +267,11 @@ void ProcessResolver::doResolve() { } for (int i = 0; i < n_procs; ++i) { +# if defined(__NetBSD__) || defined(__OpenBSD__) + addEntry(procs_info[i].p_pid, procs_info[i].p_comm, m_processMap); +# else addEntry(procs_info[i].ki_pid, procs_info[i].ki_comm, m_processMap); +# endif } kvm_cleanup(kd);