[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] use gettimeofday() instead of time()
From: |
Zhang, Yang Z |
Subject: |
[Qemu-devel] [PATCH 2/3] use gettimeofday() instead of time() |
Date: |
Fri, 6 Jan 2012 07:37:29 +0000 |
use gettimeofday() instead of time().
Please refer the patch zero for the description.
Signed-off-by: Yang Zhang <address@hidden>
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)
- [Qemu-devel] [PATCH 2/3] use gettimeofday() instead of time(),
Zhang, Yang Z <=