mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 20:25:38 +03:00
battery-util: debug log when we're unsure about the battery level
This commit is contained in:
parent
3397a14327
commit
13119207da
@ -267,13 +267,11 @@ int battery_is_discharging_and_low(void) {
|
||||
}
|
||||
|
||||
/* If we found a battery whose state we couldn't read, don't assume we are in low battery state */
|
||||
if (unsure)
|
||||
if (unsure) {
|
||||
log_debug("Found battery with unreadable state, assuming not in low battery state.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Found no charged battery, but did find low batteries */
|
||||
if (found_low)
|
||||
return true;
|
||||
|
||||
/* Found neither charged nor low batteries? let's return that we aren't on low battery state */
|
||||
return false;
|
||||
/* If found neither charged nor low batteries, assume that we aren't in low battery state */
|
||||
return found_low;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user