sleep-config: rename can_sleep_state() parameter

Just some trivial renaming, to indicate that these are not the supported
but the requested sleep states.
This commit is contained in:
Lennart Poettering
2023-06-20 13:11:53 +02:00
parent 68f8a86a46
commit fd6ec01d28
+4 -4
View File
@@ -510,11 +510,11 @@ int check_wakeup_type(void) {
return false;
}
int can_sleep_state(char **types) {
int can_sleep_state(char **requested_types) {
_cleanup_free_ char *text = NULL;
int r;
if (strv_isempty(types))
if (strv_isempty(requested_types))
return true;
/* If /sys is read-only we cannot sleep */
@@ -530,13 +530,13 @@ int can_sleep_state(char **types) {
}
const char *found;
r = string_contains_word_strv(text, NULL, types, &found);
r = string_contains_word_strv(text, NULL, requested_types, &found);
if (r < 0)
return log_debug_errno(r, "Failed to parse /sys/power/state: %m");
if (r > 0)
log_debug("Sleep mode \"%s\" is supported by the kernel.", found);
else if (DEBUG_LOGGING) {
_cleanup_free_ char *t = strv_join(types, "/");
_cleanup_free_ char *t = strv_join(requested_types, "/");
log_debug("Sleep mode %s not supported by the kernel, sorry.", strnull(t));
}
return r;