Paolo Bonzini wrote on 2012-09-11:
> Il 11/09/2012 09:05, Zhang, Yang Z ha scritto:
>> how about the following patch:
>> 
>> diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index d63554f..30bbbe6
>> 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -556,14 +556,14
>> @@ static void rtc_set_cmos(RTCState *s, const struct tm *tm)
>> 
>>  static void rtc_update_time(RTCState *s)
>>  {
>> -    struct tm ret;
>> +    struct tm *ret;
>>      time_t guest_sec;
>>      int64_t guest_nsec;
>>      
>>      guest_nsec = get_guest_rtc_ns(s);
>>      guest_sec = guest_nsec / NSEC_PER_SEC;
>> -    gmtime_r(&guest_sec, &ret);
>> -    rtc_set_cmos(s, &ret);
>> +    ret = gmtime(&guest_sec);
>> +    rtc_set_cmos(s, ret);
>>  }
> 
> No, let's add a portability wrapper for gmtime_r instead.

Right, this is a better way to solve it.

Best regards,
Yang


Reply via email to