sleep: don't make up errors, propagate the right ones
This commit is contained in:
parent
f00aff0a02
commit
58220e6b91
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue