commit:     2cd01ca8bdcbdc612b10b6b69b652ab2904a3574
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 09:50:18 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat May 18 13:06:21 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cd01ca8

sys-apps/util-linux: Fixed floating point exception in lscpu

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 ...34_rc1-lscpu_floating_point_exception_fix.patch | 28 ++++++++++++++++++++++
 sys-apps/util-linux/util-linux-2.34_rc1.ebuild     |  4 ++++
 2 files changed, 32 insertions(+)

diff --git 
a/sys-apps/util-linux/files/util-linux-2.34_rc1-lscpu_floating_point_exception_fix.patch
 
b/sys-apps/util-linux/files/util-linux-2.34_rc1-lscpu_floating_point_exception_fix.patch
new file mode 100644
index 00000000000..b1314e0e44c
--- /dev/null
+++ 
b/sys-apps/util-linux/files/util-linux-2.34_rc1-lscpu_floating_point_exception_fix.patch
@@ -0,0 +1,28 @@
+From 836455917879333e94d4a535aa22f1235b5d4885 Mon Sep 17 00:00:00 2001
+From: Sami Kerola <[email protected]>
+Date: Sat, 18 May 2019 10:19:35 +0100
+Subject: [PATCH] lscpu: fix floating point exception
+
+FIXME: this commit should include vmware_fpe regression test inclusion.
+
+Caused-by: e5f721132ec8b8c933a396d8dcb3efcb67854f13
+Addresses: https://github.com/karelzak/util-linux/issues/788
+Reported-by: Lars Wendler <[email protected]>
+Signed-off-by: Sami Kerola <[email protected]>
+---
+ sys-utils/lscpu.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
+index ca7f6a037..7f6277f00 100644
+--- a/sys-utils/lscpu.c
++++ b/sys-utils/lscpu.c
+@@ -1925,6 +1925,8 @@ static int get_cache_full_size(struct lscpu_desc *desc,
+       /* Correction for CPU threads */
+       if (desc->nthreads > desc->ncores)
+               nshares /= (desc->nthreads / desc->ncores);
++      if (nshares < 1)
++              nshares = 1;
+ 
+       *res = (desc->ncores / nshares) * ca->size;
+       return 0;

diff --git a/sys-apps/util-linux/util-linux-2.34_rc1.ebuild 
b/sys-apps/util-linux/util-linux-2.34_rc1.ebuild
index 1c6fd4ea22a..b222e422b0f 100644
--- a/sys-apps/util-linux/util-linux-2.34_rc1.ebuild
+++ b/sys-apps/util-linux/util-linux-2.34_rc1.ebuild
@@ -63,6 +63,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
 S="${WORKDIR}/${MY_P}"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-lscpu_floating_point_exception_fix.patch
+)
+
 src_prepare() {
        default
 

Reply via email to