Fix RTC initial date computation

qemu_get_clock() returns a structure containing the time the user wants
to be set (either UTC time, a local time, or a given date). Use mktimegm()
instead of mktime() to convert it into POSIX time without taking the host
timezone into account.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5878 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2008-12-04 21:34:52 +00:00
parent bb6834cfae
commit 0cd2df75a2
3 changed files with 8 additions and 8 deletions

View file

@ -1181,7 +1181,7 @@ static void pxa2xx_rtc_init(struct pxa2xx_state_s *s)
qemu_get_timedate(&tm, 0);
wom = ((tm.tm_mday - 1) / 7) + 1;
s->last_rcnr = (uint32_t) mktime(&tm);
s->last_rcnr = (uint32_t) mktimegm(&tm);
s->last_rdcr = (wom << 20) | ((tm.tm_wday + 1) << 17) |
(tm.tm_hour << 12) | (tm.tm_min << 6) | tm.tm_sec;
s->last_rycr = ((tm.tm_year + 1900) << 9) |