From: Karel Zak Date: Thu, 31 Mar 2011 11:09:50 +0000 (+0200) Subject: lscpu: fix op-mode for /{sys,proc} dumps X-Git-Tag: v2.20-rc1~404 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e740fd81a8722e7bcfc04d44d0c1d2327b1da02;p=thirdparty%2Futil-linux.git lscpu: fix op-mode for /{sys,proc} dumps Signed-off-by: Karel Zak --- 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