diff mbox

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

Message ID A9667DDFB95DB7438FA9D7D576C3D87E018CD3@SHSMSX101.ccr.corp.intel.com
State New
Headers show

Commit Message

Zhang, Yang Z Jan. 6, 2012, 7:37 a.m. UTC
use gettimeofday() instead of time().

Please refer the patch zero for the description.

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

Comments

Sasha Levin Jan. 6, 2012, 7:43 a.m. UTC | #1
On Fri, 2012-01-06 at 07:37 +0000, Zhang, Yang Z wrote:
> Please refer the patch zero for the description. 

Each patch should have description about what it does in the changelog,
otherwise you're going to lose important information about the change.

Furthermore, cover letters don't get merged at all, which means that if
someone looks at this patch, he won't have anywhere to refer to to get
the description (besides googling for the original mails I guess).
diff mbox

Patch

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)