m68knommu: fix default starting date
Currently m68knommu boards without RTC chip start with an unexpected default date of 1999-11-30 (Actually the source asks for 2000-00-00) Make that 1970-01-01 instead, as expected. Signed-off-by: Philippe De Muyter <phdm@macqel.be> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
This commit is contained in:
parent
713e919e09
commit
47422259b4
1 changed files with 8 additions and 5 deletions
|
@ -61,13 +61,16 @@ static unsigned long read_rtc_mmss(void)
|
||||||
{
|
{
|
||||||
unsigned int year, mon, day, hour, min, sec;
|
unsigned int year, mon, day, hour, min, sec;
|
||||||
|
|
||||||
if (mach_gettod)
|
if (mach_gettod) {
|
||||||
mach_gettod(&year, &mon, &day, &hour, &min, &sec);
|
mach_gettod(&year, &mon, &day, &hour, &min, &sec);
|
||||||
else
|
if ((year += 1900) < 1970)
|
||||||
year = mon = day = hour = min = sec = 0;
|
year += 100;
|
||||||
|
} else {
|
||||||
|
year = 1970;
|
||||||
|
mon = day = 1;
|
||||||
|
hour = min = sec = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((year += 1900) < 1970)
|
|
||||||
year += 100;
|
|
||||||
|
|
||||||
return mktime(year, mon, day, hour, min, sec);
|
return mktime(year, mon, day, hour, min, sec);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue