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

Eric Blake eblake at redhat.com
Fri May 13 12:10:02 UTC 2011


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).

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110513/87e11e15/attachment-0001.sig>


More information about the libvir-list mailing list