util-linux/0064-lscpu-use-MHZ-as-number-to-be-locale-sensitive.patch
Karel Zak 6f0dbde58a RHEL-9.4.0: lscpu, logger, libblkid, libmount-monitor (2.37.4-16)
Resolves: RHEL-12783 RHEL-14612 RHEL-16048 RHEL-16071 RHEL-21257
2024-02-07 11:52:19 +01:00

32 lines
1.0 KiB
Diff

From 7049ee572ded1f139c83250c7c57c7fbfa89b658 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 24 May 2021 13:19:47 +0200
Subject: lscpu: use MHZ as number to be locale sensitive
Addresses: https://issues.redhat.com/browse/RHEL-12783
Upstream: http://github.com/util-linux/util-linux/commit/ff6513c74e7fc97e2297b12dddb58d9b6513fcaf
Fixes: https://github.com/karelzak/util-linux/issues/1316
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/lscpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 47dd9d72f..c1ac4cc7c 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -424,8 +424,8 @@ static char *get_cell_data(
is_cpu_online(cxt, cpu) ? _("yes") : _("no"));
break;
case COL_CPU_MHZ:
- if (cpu->mhz)
- xstrncpy(buf, cpu->mhz, bufsz);
+ if (cpu->mhz_cur_freq)
+ snprintf(buf, bufsz, "%.4f", cpu->mhz_cur_freq);
break;
case COL_CPU_SCALMHZ:
if (cpu->mhz_cur_freq && cpu->mhz_max_freq)
--
2.43.0