[PATCH] lscpu : -b and -c option does not give expected output.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: faizan husain <faizanh@xxxxxxxxxxxxxxxxxx>

Options for lscpu command are giving incorrect output.
As per the man page or help, '-b' option should limit the output to online CPUs
and '-c' option should limit the output to offline CPUs.
But we could see the output is same for '-a','-b' and '-c' options.

Signed-off-by: faizan husain <faizanh@xxxxxxxxxxxxxxxxxx>
---
 sys-utils/lscpu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index b93998a..648f51e 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1101,12 +1101,12 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 #endif
 	print_n(_("CPU(s):"), desc->ncpus);
 
-	if (desc->online)
+	if (desc->online && mod->online)
 		print_cpuset(mod->hex ? _("On-line CPU(s) mask:") :
 					_("On-line CPU(s) list:"),
 				desc->online, mod->hex);
 
-	if (desc->online && CPU_COUNT_S(setsize, desc->online) != desc->ncpus) {
+	if (desc->online && mod->online && CPU_COUNT_S(setsize, desc->online) != desc->ncpus) {
 		cpu_set_t *set;
 
 		/* Linux kernel provides cpuset of off-line CPUs that contains
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux