[libvirt] [PATCH] time_t is not a long on FreeBSD, need to add casts

Matthias Bolte matthias.bolte at googlemail.com
Sat May 14 08:32:49 UTC 2011


2011/5/13 Eric Blake <eblake at redhat.com>:
> On 05/12/2011 11:53 PM, Matthias Bolte wrote:
>> ---
>>  src/conf/domain_conf.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index d3efec6..875f90e 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>> @@ -9115,7 +9115,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
>>
>>      def->name = virXPathString("string(./name)", ctxt);
>>      if (def->name == NULL)
>> -        ignore_value(virAsprintf(&def->name, "%ld", tv.tv_sec));
>> +        ignore_value(virAsprintf(&def->name, "%ld", (long)tv.tv_sec));
>
> Ouch.  Cygwin is thinking of making time_t a 64-bit entity, but since
> cygwin is 32-bit, that's larger than long.
>
> We need to use %lld and (long long) instead (or %jd and intmax_t).
>

Okay here are the two affected patches with long long instead of long.

Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-time_t-is-not-a-long-on-FreeBSD-need-to-add-casts.patch
Type: text/x-diff
Size: 2369 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110514/1dcc0ef1/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-virsh-time_t-is-not-a-long-on-FreeBSD.patch
Type: text/x-diff
Size: 1581 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110514/1dcc0ef1/attachment-0003.bin>


More information about the libvir-list mailing list