From 0e5afeed72baab08821e647d950690cc1f35dfe0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 28 2020 10:53:17 +0000 Subject: import powertop-2.12-2.el8 --- diff --git a/.gitignore b/.gitignore index 1cbfdf2..2effa63 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/powertop-2.11.tar.gz +SOURCES/powertop-2.12.tar.gz diff --git a/.powertop.metadata b/.powertop.metadata index 7515135..858f27c 100644 --- a/.powertop.metadata +++ b/.powertop.metadata @@ -1 +1 @@ -c39cec7fcb8a491f4e1bd26f1a7e6c28bb38f3c2 SOURCES/powertop-2.11.tar.gz +2b990862b223f81353baeab67c0c616d6122618d SOURCES/powertop-2.12.tar.gz diff --git a/SOURCES/powertop-2.12-coverity-fixes.patch b/SOURCES/powertop-2.12-coverity-fixes.patch new file mode 100644 index 0000000..66d3371 --- /dev/null +++ b/SOURCES/powertop-2.12-coverity-fixes.patch @@ -0,0 +1,37 @@ +diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp +index 370b762..8af033b 100644 +--- a/src/cpu/intel_cpus.cpp ++++ b/src/cpu/intel_cpus.cpp +@@ -155,8 +155,10 @@ void intel_util::byt_has_ahci() + if (!dir) + byt_ahci_support=0; + else ++ { + byt_ahci_support=1; +- closedir(dir); ++ closedir(dir); ++ } + } + + int intel_util::get_byt_ahci_support() +diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp +index c958865..0509d0f 100644 +--- a/src/devices/devfreq.cpp ++++ b/src/devices/devfreq.cpp +@@ -229,7 +229,6 @@ static void devfreq_dev_callback(const char *d_name) + + void create_all_devfreq_devices(void) + { +- struct dirent *entry; + int num = 0; + + std::string p = "/sys/class/devfreq/"; +@@ -240,7 +239,7 @@ void create_all_devfreq_devices(void) + return; + } + +- while((entry = readdir(dir)) != NULL) ++ while(readdir(dir) != NULL) + num++; + + if (num == 2) { diff --git a/SPECS/powertop.spec b/SPECS/powertop.spec index 9f2aa1d..ff131f0 100644 --- a/SPECS/powertop.spec +++ b/SPECS/powertop.spec @@ -1,6 +1,6 @@ Name: powertop -Version: 2.11 -Release: 1%{?dist} +Version: 2.12 +Release: 2%{?dist} Summary: Power consumption monitor Group: Applications/System @@ -11,8 +11,10 @@ Source1: powertop.service # Sent upstream Patch0: powertop-2.7-always-create-params.patch +# https://github.com/fenrus75/powertop/pull/46 +Patch1: powertop-2.12-coverity-fixes.patch BuildRequires: gettext-devel, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel -BuildRequires: automake, libtool, systemd +BuildRequires: automake, libtool, systemd, autoconf-archive BuildRequires: gcc, gcc-c++ Requires(post): systemd, coreutils Requires(preun): systemd @@ -26,12 +28,14 @@ computer use more power than necessary while it is idle. %prep %setup -q %patch0 -p1 -b .always-create-params +%patch1 -p1 -b .coverity-fixes echo "v%{version}" > version-long echo '"v%{version}"' > version-short %build -autoreconf -fi +# workaround for rhbz#1826935 +autoreconf -fi || autoreconf -fi %configure make %{?_smp_mflags} CFLAGS="%{optflags}" @@ -68,6 +72,14 @@ touch %{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results. %{_datadir}/bash-completion/completions/powertop %changelog +* Wed May 13 2020 Jaroslav Škarvada - 2.12-2 +- Fixed two new issues found by coverity + Related: rhbz#1783110 + +* Wed May 13 2020 Jaroslav Škarvada - 2.12-1 +- New version + Resolves: rhbz#1783110 + * Fri Nov 1 2019 Jaroslav Škarvada - 2.11-1 - New version Resolves: rhbz#1716721