]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep: rename read_wakealarm() → rtc_read_time()
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Oct 2018 10:40:07 +0000 (12:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Oct 2018 10:44:20 +0000 (12:44 +0200)
It doesn't read wakealarm, but the current time of the RTC. Hence, let's
rename this to make it less misleading.

src/sleep/sleep.c

index a651870641a30cfa3d7e8dba2d437ef335ea22f4..f9b822bd93dd1342cae6a6038fafae67968deab4 100644 (file)
@@ -188,7 +188,7 @@ static int execute(char **modes, char **states) {
         return r;
 }
 
-static int read_wakealarm(uint64_t *result) {
+static int rtc_read_time(uint64_t *ret_sec) {
         _cleanup_free_ char *t = NULL;
         int r;
 
@@ -196,7 +196,7 @@ static int read_wakealarm(uint64_t *result) {
         if (r < 0)
                 return r;
 
-        return safe_atou64(t, result);
+        return safe_atou64(t, ret_sec);
 }
 
 static int write_wakealarm(const char *str) {
@@ -225,7 +225,7 @@ static int execute_s2h(usec_t hibernate_delay_sec) {
         if (r < 0)
                 return r;
 
-        r = read_wakealarm(&orig_time);
+        r = rtc_read_time(&orig_time);
         if (r < 0)
                 return log_error_errno(r, "Failed to read time: %d", r);
 
@@ -242,7 +242,7 @@ static int execute_s2h(usec_t hibernate_delay_sec) {
         if (r < 0)
                 return r;
 
-        r = read_wakealarm(&cmp_time);
+        r = rtc_read_time(&cmp_time);
         if (r < 0)
                 return log_error_errno(r, "Failed to read time: %d", r);