Package: linuxinfo / 1.1.8-34

14_m68k-fixes Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Description: Correct output on m68k, use string.h
# Author: Helge Kreutzmann <debian@helgefjell.de>
# Last-Update: 2005-11-18

Index: linuxinfo-1.1.8-29/linuxinfo_m68k.c
===================================================================
--- linuxinfo-1.1.8-29.orig/linuxinfo_m68k.c	2010-02-01 21:32:00.912000806 +0100
+++ linuxinfo-1.1.8-29/linuxinfo_m68k.c	2010-02-01 21:31:37.244359000 +0100
@@ -11,12 +11,14 @@
         1.0.0   AIB     199803??        Initial development
 	1.0.1	AIB	20000405	Rework of code
 	1.0.2	AIB	20010909	Added getphysicalmemory() call
+	1.0.3	KRE	20051118	Include <string.h>
 
         This is the m68k port of linuxinfo
 */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "linuxinfo.h"
 
@@ -30,6 +32,8 @@
 
 	char temp_string[BUFSIZ], temp_string2[BUFSIZ];
 	char chip[BUFSIZ] = "Unknown";
+	char megahertz[BUFSIZ]="?";
+	char *p;
 
 	FILE *procfile;
 
@@ -41,8 +45,8 @@
                 	if (!(strcmp(temp_string, "CP")))
 				strcpy(chip, temp_string2);
 
-		if (!(strcmp(temp_string, "ClockIn")))
-			strcpy(hw->hw_megahertz, temp_string2);
+		if (!(strcmp(temp_string, "Clockin")))
+			strcpy(megahertz, temp_string2);
 
                 if (!(strcmp(temp_string, "BogoMip")))
                 {
@@ -57,5 +61,9 @@
 
 	sprintf(hw->hw_cpuinfo, "%s", chip);
 	sprintf(hw->hw_bogomips, "%0.2f", bogomips);
+
+	p = strchr(megahertz, 'M');
+        if (p) *(p) = '\0';
+	strcpy(hw->hw_megahertz, megahertz);
 }
 #endif /* system_m68k */