summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2011-03-31 13:09:50 +0200
committerKarel Zak2011-03-31 13:09:50 +0200
commit4e740fd81a8722e7bcfc04d44d0c1d2327b1da02 (patch)
tree23c22636d2180909fc377c3cead332397c6fc1eb
parentlscpu: fix threads-per-core calculation (diff)
downloadkernel-qcow2-util-linux-4e740fd81a8722e7bcfc04d44d0c1d2327b1da02.tar.gz
kernel-qcow2-util-linux-4e740fd81a8722e7bcfc04d44d0c1d2327b1da02.tar.xz
kernel-qcow2-util-linux-4e740fd81a8722e7bcfc04d44d0c1d2327b1da02.zip
lscpu: fix op-mode for /{sys,proc} dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--sys-utils/lscpu.c5
-rw-r--r--tests/expected/lscpu/lscpu-i386-dellpe7001
2 files changed, 5 insertions, 1 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index c3bb536cd..d3abb98b7 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -342,6 +342,11 @@ init_mode(void)
{
int m = 0;
+ if (sysrootlen)
+ /* reading info from any /{sys,proc} dump, don't mix it with
+ * information about our real CPU */
+ return 0;
+
#if defined(__alpha__) || defined(__ia64__)
m |= MODE_64BIT; /* 64bit platforms only */
#endif
diff --git a/tests/expected/lscpu/lscpu-i386-dellpe700 b/tests/expected/lscpu/lscpu-i386-dellpe700
index d1d95c79d..8e9f62059 100644
--- a/tests/expected/lscpu/lscpu-i386-dellpe700
+++ b/tests/expected/lscpu/lscpu-i386-dellpe700
@@ -1,4 +1,3 @@
-CPU op-mode(s): 32-bit
CPU(s): 2
Thread(s) per core: 2
Core(s) per socket: 1