CRUX-ARM :
Home
Home
::
Documentation
::
Download
::
Development
::
Community
::
Ports
::
Packages
::
Bugs
::
Links
::
About
::
Donors
development
/
crossrootfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
de59bce
)
coreutils: updated patch file
author
Jose V Beneyto
<sepen@crux.nu>
Mon, 14 Dec 2009 12:23:16 +0000
(13:23 +0100)
committer
Jose V Beneyto
<sepen@crux.nu>
Mon, 14 Dec 2009 12:23:16 +0000
(13:23 +0100)
coreutils/coreutils-uname.patch
patch
|
blob
|
blame
|
history
diff --git
a/coreutils/coreutils-uname.patch
b/coreutils/coreutils-uname.patch
index d0bf08900a479145eca4faab27b41c9f7e43fc9e..37f4729619a7acda97634dc77b51f320720fee1a 100644
(file)
--- a/
coreutils/coreutils-uname.patch
+++ b/
coreutils/coreutils-uname.patch
@@
-1,4
+1,4
@@
-
See http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/coreutils/6.10
/
+
# http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/coreutils/7.5
/
On linux platforms, grok /proc/cpuinfo for the CPU/vendor info.
On linux platforms, grok /proc/cpuinfo for the CPU/vendor info.
@@
-11,13
+11,14
@@
heavily reworked to suck less.
To add support for additional platforms, check out the show_cpuinfo()
func in the linux/arch/<ARCH>/ source tree of the kernel.
To add support for additional platforms, check out the show_cpuinfo()
func in the linux/arch/<ARCH>/ source tree of the kernel.
---- coreutils/src/uname.c
-+++ coreutils/src/uname.c
-@@ -51,6 +51,11 @@
+diff -Nru coreutils-7.6.orig/src/uname.c coreutils-7.6/src/uname.c
+--- coreutils-7.6.orig/src/uname.c 2009-09-11 16:34:48.000000000 +0200
++++ coreutils-7.6/src/uname.c 2009-09-11 16:40:29.000000000 +0200
+@@ -50,6 +50,11 @@
# include <mach-o/arch.h>
#endif
# include <mach-o/arch.h>
#endif
-+#if defined
(__linux__)
++#if defined(__linux__)
+# define USE_PROCINFO
+# define UNAME_HARDWARE_PLATFORM
+#endif
+# define USE_PROCINFO
+# define UNAME_HARDWARE_PLATFORM
+#endif
@@
-25,7
+26,7
@@
func in the linux/arch/<ARCH>/ source tree of the kernel.
#include "system.h"
#include "error.h"
#include "quote.h"
#include "system.h"
#include "error.h"
#include "quote.h"
-@@ -1
38,6 +143
,117 @@
+@@ -1
55,6 +160
,117 @@
exit (status);
}
exit (status);
}
@@
-65,7
+66,7
@@
func in the linux/arch/<ARCH>/ source tree of the kernel.
+ }
+}
+
+ }
+}
+
-+static int __linux_procinfo
(int x, char *fstr, size_t s)
++static int __linux_procinfo(int x, char *fstr, size_t s)
+{
+ FILE *fp;
+
+{
+ FILE *fp;
+
@@
-143,33
+144,33
@@
func in the linux/arch/<ARCH>/ source tree of the kernel.
/* Print ELEMENT, preceded by a space if something has already been
printed. */
/* Print ELEMENT, preceded by a space if something has already been
printed. */
-@@ -
250,10 +344,14 @@ main (int argc, char **argv)
+@@ -
302,10 +418,14 @@
if (toprint & PRINT_PROCESSOR)
{
char const *element = unknown;
-#if HAVE_SYSINFO && defined SI_ARCHITECTURE
+#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO)
{
if (toprint & PRINT_PROCESSOR)
{
char const *element = unknown;
-#if HAVE_SYSINFO && defined SI_ARCHITECTURE
+#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO)
{
- static char processor[257];
+
static char processor[257];
+#if defined(USE_PROCINFO)
+ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor))
+#else
+#if defined(USE_PROCINFO)
+ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor))
+#else
- if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+#endif
+#endif
- element = processor;
+
element = processor;
}
#endif
}
#endif
-@@ -3
06,9 +404,13 @@ main (int argc, char **argv)
+@@ -3
58,9 +478,13 @@
if (element == unknown)
if (element == unknown)
- {
- static char hardware_platform[257];
+
{
+
static char hardware_platform[257];
+#if defined(USE_PROCINFO)
+ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform))
+#else
+#if defined(USE_PROCINFO)
+ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform))
+#else
- size_t s = sizeof hardware_platform;
- static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM };
- if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+
size_t s = sizeof hardware_platform;
+
static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM };
+
if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+#endif
+#endif
- element = hardware_platform;
- }
+
element = hardware_platform;
+
}
#endif
#endif