File ksysguard-cpuinfo.patch of Package kdebase4-workspace

From b2fe78dc801dc759d4db54ed221999dd2e1892d8 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@linux-m68k.org>
Date: Wed, 12 Sep 2012 16:34:03 +0200
Subject: [PATCH] Handle more cpuinfo formats

---
 ksysguard/ksysguardd/Linux/cpuinfo.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ksysguard/ksysguardd/Linux/cpuinfo.c b/ksysguard/ksysguardd/Linux/cpuinfo.c
index 9427ec0..0a7cd2b 100644
--- a/ksysguard/ksysguardd/Linux/cpuinfo.c
+++ b/ksysguard/ksysguardd/Linux/cpuinfo.c
@@ -95,7 +95,7 @@ static void processCpuInfo( void )
                             CpuInfoSM );
                 }
             }
-        } else if ( strcmp( tag, "cpu MHz" ) == 0 ) {
+        } else if ( strcmp( tag, "cpu MHz" ) == 0 || strcmp(tag, "clock") == 0) {
             if (HighNumCores > coreUniqueId) {
                 /* The if statement above *should* always be true, but there's no harm in being safe. */
                 sscanf( value, "%f", &Clocks[ coreUniqueId ] );
@@ -121,6 +121,8 @@ static void processCpuInfo( void )
     }
 
     numCores = coreUniqueId + 1;
+    /* Some cpuinfo formats don't have core id information. */
+    if (numProcessors == 0) numProcessors = numCores;
 
     Dirty = 0;
 }
-- 
1.7.12.3

openSUSE Build Service is sponsored by