summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2010-11-03 14:07:47 +0100
committerMichael Stapelberg <michael@stapelberg.de>2010-11-03 14:08:22 +0100
commit75670ba64a43f3382e5163b6ea7bf27de28d929b (patch)
tree1e692cb3e531c8678409d5eefbbde7f05b972311
parent0846c307d0397ced8f01d8e53ebf2e91cd687b89 (diff)
battery: use POWER_NOW if CURRENT_NOW is not available
CURRENT_NOW was deprecated for some battery types in recent linux kernels (2.6.36)
-rw-r--r--src/print_battery_info.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index c806493..36de3c8 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -58,6 +58,8 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
remaining = atoi(walk+1);
else if (BEGINS_WITH(last, "POWER_SUPPLY_CURRENT_NOW"))
present_rate = atoi(walk+1);
+ else if (BEGINS_WITH(last, "POWER_SUPPLY_POWER_NOW"))
+ present_rate = atoi(walk+1);
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Charging"))
status = CS_CHARGING;
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Full"))