/[pkgs]/devel/coreutils/coreutils-4.5.3-sysinfo.patch
ViewVC logotype

Contents of /devel/coreutils/coreutils-4.5.3-sysinfo.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download) (as text)
Sat Sep 12 09:28:48 2009 UTC (2 months, 1 week ago) by ovasik
Branch: MAIN
CVS Tags: coreutils-7_6-4_fc12, coreutils-7_6-5_fc12, coreutils-7_6-7_fc13, coreutils-7_6-2_fc12, coreutils-8_0-1_fc13, F-12-split, coreutils-7_6-3_fc12, coreutils-8_0-2_fc13, coreutils-7_6-6_fc13, coreutils-7_6-6_fc12, coreutils-7_6-1_fc12, HEAD
Changes since 1.6: +6 -6 lines
File MIME type: text/x-patch
new upstream bugfix release 7.6, removed applied patches,defuzzed the rest
1 --- coreutils-5.97/src/uname.c.sysinfo 2005-09-15 20:57:04.000000000 +0100
2 +++ coreutils-5.97/src/uname.c 2006-08-24 17:15:56.000000000 +0100
3 @@ -263,7 +263,7 @@
4 int
5 main (int argc, char **argv)
6 {
7 - static char const unknown[] = "unknown";
8 + static char unknown[] = "unknown";
9
10 /* Mask indicating which elements to print. */
11 unsigned int toprint = 0;
12 @@ -306,13 +306,35 @@
13
14 if (toprint & PRINT_PROCESSOR)
15 {
16 - char const *element = unknown;
17 + char *element = unknown;
18 #if HAVE_SYSINFO && defined SI_ARCHITECTURE
19 {
20 static char processor[257];
21 if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
22 element = processor;
23 }
24 +#else
25 + {
26 + struct utsname u;
27 + uname(&u);
28 + element = u.machine;
29 +#ifdef linux
30 + if(!strcmp(element, "i686")) { /* Check for Athlon */
31 + char cinfo[1024];
32 + FILE *f=fopen("/proc/cpuinfo", "r");
33 + if(f) {
34 + while(fgets(cinfo, 1024, f)) {
35 + if(!strncmp(cinfo, "vendor_id", 9)) {
36 + if(strstr(cinfo, "AuthenticAMD"))
37 + element="athlon";
38 + break;
39 + }
40 + }
41 + fclose(f);
42 + }
43 + }
44 +#endif
45 + }
46 #endif
47 #ifdef UNAME_PROCESSOR
48 if (element == unknown)
49 @@ -348,7 +370,7 @@
50
51 if (toprint & PRINT_HARDWARE_PLATFORM)
52 {
53 - char const *element = unknown;
54 + char *element = unknown;
55 #if HAVE_SYSINFO && defined SI_PLATFORM
56 {
57 static char hardware_platform[257];
58 @@ -356,6 +378,14 @@
59 hardware_platform, sizeof hardware_platform))
60 element = hardware_platform;
61 }
62 +#else
63 + {
64 + struct utsname u;
65 + uname(&u);
66 + element = u.machine;
67 + if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
68 + element[1]='3';
69 + }
70 #endif
71 #ifdef UNAME_HARDWARE_PLATFORM
72 if (element == unknown)

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2