freebsd patch from mirrorbox
authorBrenden Matthews <brenden1@rty.ca>
Sun, 12 Mar 2006 23:26:12 +0000 (23:26 +0000)
committerBrenden Matthews <brenden1@rty.ca>
Sun, 12 Mar 2006 23:26:12 +0000 (23:26 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@586 7f574dfc-610e-0410-a909-a81674777703

src/freebsd.c

index 8eb5bf4..0a41ca8 100644 (file)
@@ -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");