From 54a7c726b7c7a9a1ca24305bda63c113c210cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sun, 12 Oct 2014 20:12:42 +0200 Subject: Fix process detection in kicker applet naughtyprocessmonitor on openbsd --- kicker/applets/naughty/NaughtyProcessMonitor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kicker') diff --git a/kicker/applets/naughty/NaughtyProcessMonitor.cpp b/kicker/applets/naughty/NaughtyProcessMonitor.cpp index c71ba6e2f..dbd3a0580 100644 --- a/kicker/applets/naughty/NaughtyProcessMonitor.cpp +++ b/kicker/applets/naughty/NaughtyProcessMonitor.cpp @@ -409,12 +409,21 @@ NaughtyProcessMonitor::pidList() const d->cacheLoadMap_.clear () ; d->uidMap_.clear () ; for (i = 0; i < nentries; i++) { +#ifdef __OpenBSD__ + l << (unsigned long) kp[i].p_pid ; + d->cacheLoadMap_.insert (kp[i].p_pid, + (kp[i].p_uticks + + kp[i].p_sticks)) ; + d->uidMap_.insert (kp[i].p_pid, + kp[i].p_uid) ; +#else l << (unsigned long) kp[i].kp_proc.p_pid ; d->cacheLoadMap_.insert (kp[i].kp_proc.p_pid, (kp[i].kp_proc.p_uticks + kp[i].kp_proc.p_sticks)) ; d->uidMap_.insert (kp[i].kp_proc.p_pid, kp[i].kp_eproc.e_ucred.cr_uid) ; +#endif } free (kp) ; -- cgit v1.2.1