From e2da4c51182036f3352f5c0414023f8b5c69918c Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sun, 12 Mar 2006 23:26:12 +0000 Subject: [PATCH] freebsd patch from mirrorbox git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@586 7f574dfc-610e-0410-a909-a81674777703 --- src/freebsd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/freebsd.c b/src/freebsd.c index 8eb5bf41..0a41ca8f 100644 --- a/src/freebsd.c +++ b/src/freebsd.c @@ -273,9 +273,19 @@ void get_cpu_count() { int cpu_count = 0; + /* XXX + * FreeBSD doesn't allow to get per CPU load stats + * on SMP machines. It's possible to get a CPU count, + * but as we fulfil only info.cpu_usage[0], it's better + * to report there's only one CPU. It should fix some bugs + * (e.g. cpugraph) + */ +#if 0 if (GETSYSCTL("hw.ncpu", cpu_count) == 0) info.cpu_count = cpu_count; - +#endif + info.cpu_count = 1; + info.cpu_usage = malloc(info.cpu_count * sizeof(float)); if (info.cpu_usage == NULL) CRIT_ERR("malloc");