[Pkg-wmaker-commits] [wmbattery] 41/241: updates
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:37:28 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmbattery.
commit 8ee155b8435faf58e43e7637f7a618e15de04ade
Author: joey <joey at a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Date: Mon Jun 24 18:38:41 2002 +0000
updates
---
acpi.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/acpi.c b/acpi.c
index e5ca2c3..7f2fb27 100644
--- a/acpi.c
+++ b/acpi.c
@@ -209,7 +209,7 @@ int acpi_read (int battery, apm_info *info) {
info->battery_flags = 0;
info->using_minutes = 1;
- /* Work out if the battery is present, and what pqercentage of full
+ /* Work out if the battery is present, and what percentage of full
* it is and how much time is left. */
if (strcmp(scan_acpi_value(buf, "Present:"), "yes") == 0) {
int pcap = scan_acpi_num(buf, "Remaining Capacity:");
@@ -233,19 +233,16 @@ int acpi_read (int battery, apm_info *info) {
else if (strcmp(rate_s, "unknown") == 0) {
goto NOBATT;
}
+ else {
+ /* a zero in the file; time unknown */
+ info->battery_time = 0;
+ }
}
state = scan_acpi_value(buf, "State:");
if (state) {
if (state[0] == 'd') { /* discharging */
info->battery_status = BATTERY_STATUS_CHARGING;
- /* In a serious fit of stupidity, Linux's
- * ACPI output uses a *second* State: line
- * when the battery is critically low.
- * Detect that. */
- if (state && state[0] == 'c') { /* critical */
- info->battery_status = BATTERY_STATUS_CRITICAL;
- }
}
else if (state[0] == 'c' && state[1] == 'h') { /* charging */
info->battery_status = BATTERY_STATUS_CHARGING;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbattery.git
More information about the Pkg-wmaker-commits
mailing list