forked from pool/powertop
This commit is contained in:
parent
3a165a3d7b
commit
242354fcca
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ba2ca0c84cba1828de28136ec3be526871bb72f18137c9820aaa7bdedb1b76fc
|
||||
size 14431
|
3
powertop-1.3.tar.gz
Normal file
3
powertop-1.3.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:28ca6fb041e6b2a78c249c074099f09dc2366665fbc06cf0d75dc0104feb7f0e
|
||||
size 15743
|
@ -1,66 +0,0 @@
|
||||
--- config.c 2007-05-13 19:22:30.000000000 +0200
|
||||
+++ config.c 2007-05-15 10:16:16.000000000 +0200
|
||||
@@ -47,7 +47,8 @@
|
||||
file = popen("zcat /proc/config.gz", "r");
|
||||
while (file && !feof(file)) {
|
||||
char line[100];
|
||||
- fgets(line, 100, file);
|
||||
+ if (fgets(line, 100, file) == NULL)
|
||||
+ break;
|
||||
strcpy(configlines[configcount++], line);
|
||||
}
|
||||
pclose(file);
|
||||
@@ -56,7 +57,10 @@
|
||||
file = fopen("/proc/sys/kernel/osrelease", "r");
|
||||
if (!file)
|
||||
return;
|
||||
- fgets(version, 100, file);
|
||||
+ if (fgets(version, 100, file) == NULL) {
|
||||
+ fclose(file);
|
||||
+ return;
|
||||
+ }
|
||||
fclose(file);
|
||||
c = strchr(version, '\n');
|
||||
if (c)
|
||||
@@ -71,7 +75,8 @@
|
||||
return;
|
||||
while (!feof(file)) {
|
||||
char line[100];
|
||||
- fgets(line, 100, file);
|
||||
+ if (fgets(line, 100, file) == NULL)
|
||||
+ break;
|
||||
strcpy(configlines[configcount++], line);
|
||||
}
|
||||
fclose(file);
|
||||
--- powertop.c 2007-05-15 01:41:30.000000000 +0200
|
||||
+++ powertop.c 2007-05-15 10:14:48.000000000 +0200
|
||||
@@ -135,7 +135,8 @@
|
||||
int nr = -1;
|
||||
uint64_t count = 0;
|
||||
memset(line, 0, sizeof(line));
|
||||
- fgets(line, 1024, file);
|
||||
+ if (fgets(line, 1024, file) == NULL)
|
||||
+ break;
|
||||
c = strchr(line, ':');
|
||||
if (!c)
|
||||
continue;
|
||||
@@ -199,7 +200,8 @@
|
||||
|
||||
while (!feof(file)) {
|
||||
memset(line, 0, 4096);
|
||||
- fgets(line, 4096, file);
|
||||
+ if (fgets(line, 4096, file) == NULL)
|
||||
+ break;
|
||||
c = strstr(line, "age[");
|
||||
if (!c)
|
||||
continue;
|
||||
@@ -420,7 +422,8 @@
|
||||
while (file && !feof(file)) {
|
||||
char *count, *pid, *process, *func;
|
||||
int cnt;
|
||||
- fgets(line, 1024, file);
|
||||
+ if (fgets(line, 1024, file) == NULL)
|
||||
+ break;
|
||||
if (strstr(line, "total events"))
|
||||
break;
|
||||
c = count = &line[0];
|
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 22 13:41:56 CEST 2007 - thoenig@suse.de
|
||||
|
||||
- Update to PowerTOP 1.3
|
||||
- Remove patch powertop-fix-compiler-warnings-thoenig-02.patch:
|
||||
merged upstream
|
||||
- Changes:
|
||||
* Add suggestion for CONFIG_SND_AC97_POWER_SAVE
|
||||
* Fix inefficient code for readdir (Vince Pinter)
|
||||
* Highlight the worst offenders in bold (Vince Pinter)
|
||||
* Fix crash when running on 2.4 kernels (Harald Fernengel)
|
||||
* Check fgets() return values (Timom Hoenig @ SuSE)
|
||||
* add suggestion to enable laptop mode (when disabled)
|
||||
* add suggestion to disable bluetooth when unused
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 15 10:24:55 CEST 2007 - thoenig@suse.de
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package powertop (Version 1.2)
|
||||
# spec file for package powertop (Version 1.3)
|
||||
#
|
||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
@ -13,12 +13,11 @@
|
||||
Name: powertop
|
||||
URL: http://www.linuxpowertop.org
|
||||
Summary: PowerTOP is a Linux tool to find out what is using power on a laptop
|
||||
Version: 1.2
|
||||
Version: 1.3
|
||||
Release: 1
|
||||
License: GNU General Public License (GPL)
|
||||
Group: System/Monitoring
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Patch0: %{name}-fix-compiler-warnings-thoenig-02.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Autoreqprov: on
|
||||
|
||||
@ -35,7 +34,6 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%patch0 -p0
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" make
|
||||
@ -53,6 +51,18 @@ rm -rf %{_buildroot}
|
||||
%{_bindir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Tue May 22 2007 - thoenig@suse.de
|
||||
- Update to PowerTOP 1.3
|
||||
- Remove patch powertop-fix-compiler-warnings-thoenig-02.patch:
|
||||
merged upstream
|
||||
- Changes:
|
||||
* Add suggestion for CONFIG_SND_AC97_POWER_SAVE
|
||||
* Fix inefficient code for readdir (Vince Pinter)
|
||||
* Highlight the worst offenders in bold (Vince Pinter)
|
||||
* Fix crash when running on 2.4 kernels (Harald Fernengel)
|
||||
* Check fgets() return values (Timom Hoenig @ SuSE)
|
||||
* add suggestion to enable laptop mode (when disabled)
|
||||
* add suggestion to disable bluetooth when unused
|
||||
* Tue May 15 2007 - thoenig@suse.de
|
||||
- Update to PowerTOP 1.2 (skipped 1.1)
|
||||
- Fix battery code to work with both, mA and mW
|
||||
|
Loading…
Reference in New Issue
Block a user