sleep: don't make up errors, propagate the right ones

This commit is contained in:
Lennart Poettering 2018-10-24 12:38:04 +02:00
parent f00aff0a02
commit 58220e6b91

View file

@ -190,10 +190,13 @@ static int execute(char **modes, char **states) {
static int read_wakealarm(uint64_t *result) {
_cleanup_free_ char *t = NULL;
int r;
if (read_one_line_file("/sys/class/rtc/rtc0/since_epoch", &t) >= 0)
return safe_atou64(t, result);
return -EBADF;
r = read_one_line_file("/sys/class/rtc/rtc0/since_epoch", &t);
if (r < 0)
return r;
return safe_atou64(t, result);
}
static int write_wakealarm(const char *str) {