parent
bfa2ad7d47
commit
2cd902f09f
|
@ -31,9 +31,16 @@ time_t Libc::read_rtc()
|
||||||
{
|
{
|
||||||
time_t rtc = 0;
|
time_t rtc = 0;
|
||||||
|
|
||||||
int fd = open(Libc::config_rtc(), O_RDONLY);
|
if (!Genode::strcmp(Libc::config_rtc(), "")) {
|
||||||
if (fd == -1)
|
PWRN("%s: rtc not configured, returning %lu", __func__, rtc);
|
||||||
return rtc;
|
return rtc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int fd = open(Libc::config_rtc(), O_RDONLY);
|
||||||
|
if (fd == -1) {
|
||||||
|
PWRN("%s: %s not readable, returning %lu", __func__, Libc::config_rtc(), rtc);
|
||||||
|
return rtc;
|
||||||
|
}
|
||||||
|
|
||||||
char buf[32];
|
char buf[32];
|
||||||
ssize_t n = read(fd, buf, sizeof(buf));
|
ssize_t n = read(fd, buf, sizeof(buf));
|
||||||
|
|
Loading…
Reference in New Issue