]> git.ipfire.org Git - thirdparty/systemd.git/commit
sleep: check if we're on AC power before checking battery capacity
authorMike Yuan <me@yhndnzj.com>
Mon, 20 Feb 2023 12:12:19 +0000 (20:12 +0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Feb 2023 19:48:33 +0000 (20:48 +0100)
commite0b3a70fabb871bf55678e9e177445b1df2aee88
treeae28c74109133b4db42cd1ab6c17f498280c1e41
parentf8979e869812988835f6951fb73a68e30a4c608c
sleep: check if we're on AC power before checking battery capacity

Before this commit, battery_is_low() returns
true if there's no battery on the system.
It's now modified to check if the system is
on AC power first, and returns false early
if that's the case.

Fixes #26492
src/shared/sleep-config.c
src/shared/sleep-config.h
src/sleep/sleep.c