[PATCH 2/3] use gettimeofday() instead of time()

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

 



use gettimeofday() instead of time().

Please refer the patch zero for the description.

Signed-off-by: Yang Zhang <yang.z.zhang@xxxxxxxxx>

diff --git a/vl.c b/vl.c
index 01c5a9d..9a51047 100644
--- a/vl.c
+++ b/vl.c
@@ -438,8 +438,11 @@ void qemu_get_timedate(struct tm *tm, int64_t offset)
 {
     time_t ti;
     struct tm *ret;
+    struct timeval tv;
+
+    gettimeofday(&tv, NULL);
+    ti = tv.tv_sec;

-    time(&ti);
     ti += offset;
     if (rtc_date_offset == -1) {
         if (rtc_utc)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux