1
0
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:
Mike Yuan 2023-06-10 00:30:41 +08:00 committed by Lennart Poettering
parent 3397a14327
commit 13119207da

View File

@ -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;
}