]> git.proxmox.com Git - mirror_qemu.git/blobdiff - vl.c
Replace remaining gmtime, localtime by gmtime_r, localtime_r
[mirror_qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index f056c95807917fb0087be61abc29d51464f164fc..aed4182ae8b28b4e90c008cbe210e1606c369de3 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -448,21 +448,18 @@ StatusInfo *qmp_query_status(Error **errp)
 void qemu_get_timedate(struct tm *tm, int offset)
 {
     time_t ti;
-    struct tm *ret;
 
     time(&ti);
     ti += offset;
     if (rtc_date_offset == -1) {
         if (rtc_utc)
-            ret = gmtime(&ti);
+            gmtime_r(&ti, tm);
         else
-            ret = localtime(&ti);
+            localtime_r(&ti, tm);
     } else {
         ti -= rtc_date_offset;
-        ret = gmtime(&ti);
+        gmtime_r(&ti, tm);
     }
-
-    memcpy(tm, ret, sizeof(struct tm));
 }
 
 int qemu_timedate_diff(struct tm *tm)