rtc_time: Fix incorrect return value when the calendar is not available.

According to the C99 specification "The value (time_t)(-1) is returned if the
calendar time is not available". Before this patch, in such case the function
was returning 0 instead of -1.
pull/4480/head
Vincent Coubard 2017-06-06 23:03:28 +01:00
parent 6002bdd533
commit c335a0090c
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ time_t time(time_t *timer)
}
}
time_t t = 0;
time_t t = -1;
if (_rtc_read != NULL) {
t = _rtc_read();
}