summaryrefslogtreecommitdiff
path: root/src/shared/sleep-config.h
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-02-20 20:12:19 +0800
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-02-21 20:48:33 +0100
commite0b3a70fabb871bf55678e9e177445b1df2aee88 (patch)
treeae28c74109133b4db42cd1ab6c17f498280c1e41 /src/shared/sleep-config.h
parentf8979e869812988835f6951fb73a68e30a4c608c (diff)
downloadsystemd-e0b3a70fabb871bf55678e9e177445b1df2aee88.tar.gz
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
Diffstat (limited to 'src/shared/sleep-config.h')
-rw-r--r--src/shared/sleep-config.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/sleep-config.h b/src/shared/sleep-config.h
index 99423fe3d3..5c528b890b 100644
--- a/src/shared/sleep-config.h
+++ b/src/shared/sleep-config.h
@@ -60,7 +60,7 @@ int find_hibernate_location(HibernateLocation **ret_hibernate_location);
int can_sleep(SleepOperation operation);
int can_sleep_disk(char **types);
int can_sleep_state(char **types);
-int battery_is_low(void);
+int battery_is_discharging_and_low(void);
int get_total_suspend_interval(Hashmap *last_capacity, usec_t *ret);
int fetch_batteries_capacity_by_name(Hashmap **ret_current_capacity);
int get_capacity_by_name(Hashmap *capacities_by_name, const char *name);