! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Fixes for OpenBSD support
Status:
RESOLVED: FIXED
Product:
Xfce4-cpugraph-plugin
Component:
General

Comments

Description Landry Breuil editbugs 2008-07-15 12:24:25 CEST
This patch is against 0.3.0, but applies (with manual tweaks) to trunk too :

--- panel-plugin/os.c.orig      Tue Jul 15 14:10:04 2008
+++ panel-plugin/os.c   Tue Jul 15 14:11:46 2008
@@ -101,12 +101,12 @@ long GetCPUUsage (int *oldusage, int *oldtotal)
 
        return usage;
 }
-#elif defined (__OpenBSD_)
+#elif defined (__OpenBSD__)
 long GetCPUUsage (int *oldusage, int *oldtotal)
 {
         long user, nice, sys, bsdidle, idle;
          long used, total, usage;
-         static int mib[] = {CTL_KERN, KERN_CP_TIME };
+         static int mib[] = {CTL_KERN, KERN_CPTIME };
          u_int64_t cp_time[CPUSTATES];
          size_t len = sizeof (cp_time);
          if (sysctl (mib, 2, &cp_time, &len, NULL, 0) < 0)
@@ -134,5 +134,5 @@ long GetCPUUsage (int *oldusage, int *oldtotal)
         return usage;  
 }
 #else
-#error "You're OS is not supported."
+#error "Your OS is not supported."
 #endif

Awaiting next release, with full *BSD support (not like 0.4.0 :)
Comment 1 Florian Rivoal editbugs 2010-04-17 14:44:54 CEST
I applied the patch, so I'll mark this as fixed. Unfortunately, I don't have a access to an openbsd machine, so I'll be glad if someone could check for me that it works as intended.

Bug #4228

Reported by:
Landry Breuil
Reported on: 2008-07-15
Last modified on: 2010-10-03

People

Assignee:
Florian Rivoal
CC List:
1 user

Version

Version:
0.3.0 or older

Attachments

Additional information