[libvirt] [PATCH libvirt 6/6] Cast timeval.tv_sec long to localtime expected type time_t

Eric Blake eblake at redhat.com
Thu Jan 26 01:05:48 UTC 2012


[adding bug-gnulib]

On 01/25/2012 01:13 PM, Marc-André Lureau wrote:
> ---
>  tools/virsh.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 999941c..246e638 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -3703,7 +3703,7 @@ vshGenFileName(vshControl *ctl, virDomainPtr dom, const char *mime)
>      /* add mime type here */
>  
>      gettimeofday(&cur_time, NULL);
> -    localtime_r(&cur_time.tv_sec, &time_info);
> +    localtime_r((time_t *)&cur_time.tv_sec, &time_info);

NAK.  tv_sec should already be time_t.  This is a bug in your system
header definition of 'struct timespec', or in something that gnulib has
done to that struct in the meantime; and we should make gnulib work
around it if we can't get if fixed in mingw.

Can you help us identify why we are getting a type mismatch warning from
the compiler in the first place?

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list