]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep-config: rename can_sleep_state() parameter
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Jun 2023 10:22:28 +0000 (12:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Jun 2023 11:11:53 +0000 (13:11 +0200)
Just some trivial renaming, to indicate that these are not the supported
but the requested sleep states.

src/shared/sleep-config.c

index dcc233ca6f3d9a75029ba9887a6b51f5aa7a2248..cba5993afe8a98096be9734afb69b625dad161cd 100644 (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;