[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] hvm: Correct RTC time offset update error due to tm->tm_year
The mktime which used in xen is different from standard C. I think the best way is change it same as normal mktime, or else, other people will make the same mistake too. 2012/2/20, Zhang, Yang Z <yang.z.zhang@xxxxxxxxx>: >> -----Original Message----- >> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx >> [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of ANNIE LI >> Sent: Monday, February 20, 2012 3:20 PM >> >> Hi >> >> In rtc_set_time, mktime is called to calculate seconds since 1970/01/01, >> input >> parameters of mktime are required to be in normal date format. >> Such as: year=1980, mon=12, day=31, hour=23, min=59, sec=59. However, the >> current input parameter of mktime is tm->tm_year, and it is the number of >> years >> since 1900. (For example, if current time is 2012/12/31, and tm->tm_year >> is 112). >> This is not suitable for requirement of mktime. >> So I think tm->tm_year should be changed to tm->tm_year+1900 when calling >> mktime. Please check the patch attached. >> > No, tm_year is the number of years since 1900, not the normal date format. > > best regards > yang > _______________________________________________ > Xen-devel mailing list > Xen-devel@xxxxxxxxxxxxxxxxxxx > http://lists.xensource.com/xen-devel > -- young _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |