diff options
Diffstat (limited to 'sys/isa/atrtc.c')
| -rw-r--r-- | sys/isa/atrtc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index f8e1c4e39d07..a519a9e7d641 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -679,8 +679,7 @@ inittodr(time_t base) /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) { - printf("Invalid time in real time clock.\n"); - printf("Check and reset the date immediately!\n"); + printf("Invalid time in clock: check and reset the date!\n"); return; } @@ -704,7 +703,11 @@ inittodr(time_t base) #else ct.year += 2000; #endif - clock_ct_to_ts(&ct, &ts); + /* Should we set dow = -1 because some clocks don't set it correctly? */ + if (clock_ct_to_ts(&ct, &ts)) { + printf("Invalid time in clock: check and reset the date!\n"); + return; + } ts.tv_sec += utc_offset(); tc_setclock(&ts); } |
