qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/3] use gettimeofday() instead of time()
@ 2012-01-06  7:37 Zhang, Yang Z
  2012-01-06  7:43 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang, Yang Z @ 2012-01-06  7:37 UTC (permalink / raw)
  To: qemu-devel@nongnu.org
  Cc: aliguori@us.ibm.com, Shan, Haitao, avi@redhat.com,
	kvm@vger.kernel.org

use gettimeofday() instead of time().

Please refer the patch zero for the description.

Signed-off-by: Yang Zhang <yang.z.zhang@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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-06  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-06  7:37 [Qemu-devel] [PATCH 2/3] use gettimeofday() instead of time() Zhang, Yang Z
2012-01-06  7:43 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).