From 4e740fd81a8722e7bcfc04d44d0c1d2327b1da02 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 31 Mar 2011 13:09:50 +0200 Subject: [PATCH] lscpu: fix op-mode for /{sys,proc} dumps Signed-off-by: Karel Zak --- sys-utils/lscpu.c | 5 +++++ tests/expected/lscpu/lscpu-i386-dellpe700 | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index c3bb536cd6..d3abb98b78 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 d1d95c79d7..8e9f62059f 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 -- 2.47.2