wmbattery: Avoid uninitialized variable warning.
Move assignment of old_status until after cur_info is initialized in wmbattery.c.
This commit is contained in:
parent
21c37ad492
commit
773552ebd8
|
@ -528,7 +528,6 @@ void alarmhandler(int sig) {
|
|||
apm_info cur_info;
|
||||
int old_status;
|
||||
|
||||
old_status = cur_info.battery_status;
|
||||
#ifdef UPOWER
|
||||
if (use_upower) {
|
||||
if (upower_read(1, &cur_info) != 0)
|
||||
|
@ -555,7 +554,9 @@ void alarmhandler(int sig) {
|
|||
if (sonypi_read(&cur_info) != 0)
|
||||
error("Cannot read sonypi information.");
|
||||
}
|
||||
|
||||
|
||||
old_status = cur_info.battery_status;
|
||||
|
||||
/* Always calculate remaining lifetime? apm and acpi both use a
|
||||
* negative number here to indicate error, missing battery, or
|
||||
* cannot determine time. */
|
||||
|
|
Loading…
Reference in a new issue