aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-07-26 22:13:27 +0000
committerBill Nottingham <notting@redhat.com>2005-07-26 22:13:27 +0000
commit3bee311d6fd4eccf3e031578808d75876b61a3c4 (patch)
tree196e767f5fe375dc5193048cc8a773c8735eee77
parent480564380fe0fa73a85feb30c4a91ea0fdb97d46 (diff)
downloadinitscripts-r7-93-17-EL.tar
initscripts-r7-93-17-EL.tar.gz
initscripts-r7-93-17-EL.tar.bz2
initscripts-r7-93-17-EL.tar.xz
initscripts-r7-93-17-EL.zip
handle multi-core itanium (#163783)r7-93-17-EL
-rw-r--r--initscripts.spec5
-rw-r--r--src/redhat-support-check.c30
2 files changed, 32 insertions, 3 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 1c8e9a22..ed487b6d 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -1,6 +1,6 @@
Summary: The inittab file and the /etc/init.d scripts.
Name: initscripts
-Version: 7.93.16.EL
+Version: 7.93.17.EL
License: GPL
Group: System Environment/Base
Release: 1
@@ -206,6 +206,9 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+* Tue Jul 26 2005 Bill Nottingham <notting@redhat.com> 7.93.17.EL-1
+- redhat-support-check: handle multi-core ia64 (#163783)
+
* Fri Jul 22 2005 Bill Nottingham <notting@redhat.com> 7.93.16.EL-1
- fix invalid free (#163973, <dwalsh@redhat.com>)
diff --git a/src/redhat-support-check.c b/src/redhat-support-check.c
index 93ea9154..dd5bc162 100644
--- a/src/redhat-support-check.c
+++ b/src/redhat-support-check.c
@@ -26,7 +26,8 @@
#define _(String) gettext((String))
-#define SUPPORTINFO "/var/lib/supportinfo"
+#define SUPPORTINFO "/var/lib/supportinfo"
+#define CPUINFO "/proc/cpuinfo"
static int min_mem = 0;
static int max_mem = 0;
@@ -64,9 +65,10 @@ guint64 get_memory() {
unsigned int get_num_cpus() {
int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
- u_int32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
#if defined(__i386__) || defined(__x86_64__)
+ u_int32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
+
cpuid(0, &eax, &ebx, &ecx, &edx);
if (ebx == 0x756e6547) { /* Intel */
cpuid(1, &eax, &ebx, &ecx, &edx);
@@ -92,6 +94,30 @@ unsigned int get_num_cpus() {
}
}
#endif
+#if defined(__ia64__)
+ gchar *contents, **lines;
+ gsize len;
+ int x;
+ GList *list = NULL;
+
+ g_file_get_contents(CPUINFO, &contents, &len, NULL);
+ if (!contents)
+ return ncpus;
+ lines = g_strsplit(contents,"\n", 0);
+
+ len = 0;
+ for (x = 0; lines[x]; x++) {
+ if (g_str_has_prefix(lines[x],"physical id")) {
+ if (!g_list_find_custom(list, lines[x],g_ascii_strcasecmp))
+ list = g_list_prepend(list, lines[x]);
+ }
+ }
+ len = g_list_length(list);
+ if (len) {
+ g_list_free(list);
+ ncpus = len;
+ }
+#endif
return ncpus;
}