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

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

 



On Fri, May 13, 2011 at 08:31:28AM +0200, Matthias Bolte wrote:
> localtime_r expects time_t.
> ---
>  tools/virsh.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 3baa015..93a504e 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -10406,7 +10406,8 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
>      char *doc = NULL;
>      virDomainSnapshotPtr snapshot = NULL;
>      char *state = NULL;
> -    long creation;
> +    long creation_long;
> +    time_t creation_time_t;
>      char timestr[100];
>      struct tm time_info;
>  
> @@ -10466,9 +10467,10 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
>              if (state == NULL)
>                  continue;
>              if (virXPathLong("string(/domainsnapshot/creationTime)", ctxt,
> -                             &creation) < 0)
> +                             &creation_long) < 0)
>                  continue;
> -            localtime_r(&creation, &time_info);
> +            creation_time_t = creation_long;
> +            localtime_r(&creation_time_t, &time_info);
>              strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %z", &time_info);
>  
>              vshPrint(ctl, " %-20s %-25s %s\n", names[i], timestr, state);

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]