Fixed a couple problems in the time keeping mechanism, which got broken lately. Done in tandem with Korli
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15846 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -205,7 +205,7 @@ rtc_tm_to_secs(const struct tm *t)
|
|||||||
uint32 time = 0;
|
uint32 time = 0;
|
||||||
uint32 i;
|
uint32 i;
|
||||||
|
|
||||||
wholeYear = 1900 + t->tm_year;
|
wholeYear = RTC_EPOCHE_BASE_YEAR + t->tm_year;
|
||||||
|
|
||||||
// ToDo: get rid of these loops and compute the correct value
|
// ToDo: get rid of these loops and compute the correct value
|
||||||
// i.e. days = (long)(year > 0) + year*365 + --year/4 - year/100 + year/400;
|
// i.e. days = (long)(year > 0) + year*365 + --year/4 - year/100 + year/400;
|
||||||
@@ -328,7 +328,7 @@ _user_set_timezone(time_t timezoneOffset, bool daylightSavingTime)
|
|||||||
// Since this is shared data, we need to update it atomically.
|
// Since this is shared data, we need to update it atomically.
|
||||||
if (!sIsGMT) {
|
if (!sIsGMT) {
|
||||||
arch_rtc_set_system_time_offset(sRealTimeData,
|
arch_rtc_set_system_time_offset(sRealTimeData,
|
||||||
sTimezoneOffset - offset);
|
arch_rtc_get_system_time_offset(sRealTimeData) + sTimezoneOffset - offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
sTimezoneOffset = offset;
|
sTimezoneOffset = offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user