Re: [PATCH v2] virsh: time_t is not a long on FreeBSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/5/25 Eric Blake <eblake@xxxxxxxxxx>:
> On 05/25/2011 09:06 AM, Matthias Bolte wrote:
>> localtime_r expects time_t.
>> ---
>> v2: add overflow check
>
> ACK.
>
>> - Â Â Â Â Â Âlocaltime_r(&creation, &time_info);
>> + Â Â Â Â Â Âcreation_time_t = creation_longlong;
>> + Â Â Â Â Â Âif (creation_time_t != creation_longlong) {
>> + Â Â Â Â Â Â Â ÂvshError(ctl, "%s", _("time_t overflow"));
>
> We shouldn't hit this error until 2038, and by then, hopefully more
> 32-bit platforms (if any are still running) will have switched to 64-bit
> time_t. :) ÂBut I agree with keeping this error in the code, since
> silent wraparound is always worse than explicit mention of overflow.

I like to be on the safe side :)

Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]