sleep: rename read_wakealarm() → rtc_read_time()

It doesn't read wakealarm, but the current time of the RTC. Hence, let's
rename this to make it less misleading.
This commit is contained in:
Lennart Poettering 2018-10-24 12:40:07 +02:00
parent 6ce63245f6
commit c16669a309

View 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);