summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorHeiko Carstens2011-09-10 12:25:04 +0200
committerKarel Zak2011-09-12 12:39:30 +0200
commite43fc13e7675445a76305e4f5e52352b3fc2203a (patch)
tree1448a98b9a6e6664f9bd85d5fbe29ec12603466f /sys-utils/lscpu.c
parentlib,cpuset: fix compiler warning [-Wuninitialized] (diff)
downloadkernel-qcow2-util-linux-e43fc13e7675445a76305e4f5e52352b3fc2203a.tar.gz
kernel-qcow2-util-linux-e43fc13e7675445a76305e4f5e52352b3fc2203a.tar.xz
kernel-qcow2-util-linux-e43fc13e7675445a76305e4f5e52352b3fc2203a.zip
lscpu: s/Y/Yes/ s/N/No/
However I'd like to see one change if you don't object: printing just "N" or "Y" instead of "No" and "Yes" in the human readable output looks a bit ugly to me. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r--sys-utils/lscpu.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 601c8729c..6a37bb3b8 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -995,13 +995,24 @@ get_cell_data(struct lscpu_desc *desc, int cpu, int col,
snprintf(buf, bufsz, "%d", desc->addresses[cpu]);
break;
case COL_CONFIGURED:
- if (desc->configured)
+ if (!desc->configured)
+ break;
+ if (mod->mode == OUTPUT_PARSABLE)
snprintf(buf, bufsz,
desc->configured[cpu] ? _("Y") : _("N"));
+ else
+ snprintf(buf, bufsz,
+ desc->configured[cpu] ? _("Yes") : _("No"));
break;
case COL_ONLINE:
- if (desc->online)
- snprintf(buf, bufsz, is_cpu_online(desc, cpu) ? _("Y") : _("N"));
+ if (!desc->online)
+ break;
+ if (mod->mode == OUTPUT_PARSABLE)
+ snprintf(buf, bufsz,
+ is_cpu_online(desc, cpu) ? _("Y") : _("N"));
+ else
+ snprintf(buf, bufsz,
+ is_cpu_online(desc, cpu) ? _("Yes") : _("No"));
break;
}
return buf;