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

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

[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 redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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