coreutils/coreutils-4.5.3-sysinfo.patch

73 lines
1.7 KiB
Diff
Raw Normal View History

2006-08-24 16:25:40 +00:00
--- coreutils-5.97/src/uname.c.sysinfo 2005-09-15 20:57:04.000000000 +0100
+++ coreutils-5.97/src/uname.c 2006-08-24 17:15:56.000000000 +0100
@@ -263,7 +263,7 @@
int
2006-08-24 16:25:40 +00:00
main (int argc, char **argv)
{
- static char const unknown[] = "unknown";
+ static char unknown[] = "unknown";
/* Mask indicating which elements to print. */
unsigned int toprint = 0;
@@ -306,13 +306,35 @@
2006-08-24 16:25:40 +00:00
if (toprint & PRINT_PROCESSOR)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_ARCHITECTURE
{
static char processor[257];
auto-import changelog data from coreutils-4.5.3-7.src.rpm Mon Dec 09 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-7 - Fix mv (bug #79283). - Add patch27 (nogetline). Sun Dec 01 2002 Tim Powers <timp@redhat.com> 4.5.3-6 - use the su.pamd from sh-utils since it works properly with multilib systems Fri Nov 29 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-5 - Fix test suite quoting problems. Fri Nov 29 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-4 - Fix scriplets. - Fix i18n patch so it doesn't break uniq. - Fix several other patches to either make the test suite pass or not run the relevant tests. - Run 'make check'. - Fix file list. Thu Nov 28 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-3 - Adapted for Red Hat Linux. - Self-host for help2man. - Don't ship readlink just yet (maybe later). - Merge patches from fileutils and sh-utils (textutils ones are already merged it seems). - Keep the binaries where the used to be (in particular, id and stat). Sun Nov 17 2002 Stew Benedict <sbenedict@mandrakesoft.com> 4.5.3-2mdk - LI18NUX/LSB compliance (patch800) - Installed (but unpackaged) file(s) - /usr/share/info/dir Thu Oct 31 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.3-1mdk - new release - rediff patch 180 - merge patch 150 into 180 Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-6mdk - move su back to /bin Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-5mdk - patch 0 : lg locale is illegal and must be renamed lug (pablo) Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-4mdk - fix conflict with procps Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-3mdk - patch 105 : fix install -s Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-2mdk - fix build - don't chmode two times su - build with large file support - fix description - various spec cleanups - fix chroot installation - fix missing /bin/env - add old fileutils, sh-utils & textutils ChangeLogs Fri Oct 11 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-1mdk - initial release (merge fileutils, sh-utils & textutils) - obsoletes/provides: sh-utils/fileutils/textutils - fileutils stuff go in 1xx range - sh-utils stuff go in 7xx range - textutils stuff go in 5xx range - drop obsoletes patches 1, 2, 10 (somes files're gone but we didn't ship most of them) - rediff patches 103, 105, 111, 113, 180, 706 - temporary disable patch 3 & 4 - fix fileutils url
2004-09-09 03:55:45 +00:00
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
element = processor;
}
+#else
+ {
+ struct utsname u;
+ uname(&u);
+ element = u.machine;
+#ifdef linux
+ if(!strcmp(element, "i686")) { /* Check for Athlon */
+ char cinfo[1024];
+ FILE *f=fopen("/proc/cpuinfo", "r");
+ if(f) {
+ while(fgets(cinfo, 1024, f)) {
+ if(!strncmp(cinfo, "vendor_id", 9)) {
+ if(strstr(cinfo, "AuthenticAMD"))
+ element="athlon";
+ break;
+ }
+ }
+ fclose(f);
+ }
+ }
+#endif
+ }
#endif
#ifdef UNAME_PROCESSOR
if (element == unknown)
@@ -348,7 +370,7 @@
2006-08-24 16:25:40 +00:00
if (toprint & PRINT_HARDWARE_PLATFORM)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_PLATFORM
{
static char hardware_platform[257];
@@ -356,6 +378,14 @@
auto-import changelog data from coreutils-4.5.3-7.src.rpm Mon Dec 09 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-7 - Fix mv (bug #79283). - Add patch27 (nogetline). Sun Dec 01 2002 Tim Powers <timp@redhat.com> 4.5.3-6 - use the su.pamd from sh-utils since it works properly with multilib systems Fri Nov 29 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-5 - Fix test suite quoting problems. Fri Nov 29 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-4 - Fix scriplets. - Fix i18n patch so it doesn't break uniq. - Fix several other patches to either make the test suite pass or not run the relevant tests. - Run 'make check'. - Fix file list. Thu Nov 28 2002 Tim Waugh <twaugh@redhat.com> 4.5.3-3 - Adapted for Red Hat Linux. - Self-host for help2man. - Don't ship readlink just yet (maybe later). - Merge patches from fileutils and sh-utils (textutils ones are already merged it seems). - Keep the binaries where the used to be (in particular, id and stat). Sun Nov 17 2002 Stew Benedict <sbenedict@mandrakesoft.com> 4.5.3-2mdk - LI18NUX/LSB compliance (patch800) - Installed (but unpackaged) file(s) - /usr/share/info/dir Thu Oct 31 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.3-1mdk - new release - rediff patch 180 - merge patch 150 into 180 Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-6mdk - move su back to /bin Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-5mdk - patch 0 : lg locale is illegal and must be renamed lug (pablo) Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-4mdk - fix conflict with procps Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-3mdk - patch 105 : fix install -s Mon Oct 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-2mdk - fix build - don't chmode two times su - build with large file support - fix description - various spec cleanups - fix chroot installation - fix missing /bin/env - add old fileutils, sh-utils & textutils ChangeLogs Fri Oct 11 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-1mdk - initial release (merge fileutils, sh-utils & textutils) - obsoletes/provides: sh-utils/fileutils/textutils - fileutils stuff go in 1xx range - sh-utils stuff go in 7xx range - textutils stuff go in 5xx range - drop obsoletes patches 1, 2, 10 (somes files're gone but we didn't ship most of them) - rediff patches 103, 105, 111, 113, 180, 706 - temporary disable patch 3 & 4 - fix fileutils url
2004-09-09 03:55:45 +00:00
hardware_platform, sizeof hardware_platform))
element = hardware_platform;
}
+#else
+ {
+ struct utsname u;
+ uname(&u);
+ element = u.machine;
+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
+ element[1]='3';
+ }
#endif
#ifdef UNAME_HARDWARE_PLATFORM
if (element == unknown)