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

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

 



---
 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);
     strftime(timestr, sizeof(timestr), "%Y-%m-%d-%H:%M:%S", &time_info);
 
     if (virAsprintf(&ret, "%s-%s%s", virDomainGetName(dom),
@@ -18101,7 +18101,7 @@ vshOutputLogFile(vshControl *ctl, int log_level, const char *msg_format,
      * [YYYY.MM.DD HH:MM:SS SIGNATURE PID] LOG_LEVEL message
     */
     gettimeofday(&stTimeval, NULL);
-    stTm = localtime(&stTimeval.tv_sec);
+    stTm = localtime((time_t *)&stTimeval.tv_sec);
     virBufferAsprintf(&buf, "[%d.%02d.%02d %02d:%02d:%02d %s %d] ",
                       (1900 + stTm->tm_year),
                       (1 + stTm->tm_mon),
-- 
1.7.7.5

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