use gettimeofday() instead of time().

Please refer the patch zero for the description.

Signed-off-by: Yang Zhang <yang.z.zh...@intel.com>

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)

Reply via email to