]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Use UTC/localtime flag in M48Txx
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 4 Aug 2007 10:56:25 +0000 (10:56 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 4 Aug 2007 10:56:25 +0000 (10:56 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3111 c046a42c-6fe2-441c-8c8c-71466251a162

hw/m48t59.c

index cda28c2f659049577807f7e8a5f6c95dbf467831..053acb5c06cda637367b4df95085aed69210c9c5 100644 (file)
@@ -80,7 +80,10 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm)
 #ifdef _WIN32
     memcpy(tm,localtime(&t),sizeof(*tm));
 #else
-    localtime_r (&t, tm) ;
+    if (rtc_utc)
+        gmtime_r (&t, tm);
+    else
+        localtime_r (&t, tm) ;
 #endif
 }
 
@@ -146,7 +149,10 @@ static void get_alarm (m48t59_t *NVRAM, struct tm *tm)
 #ifdef _WIN32
     memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm));
 #else
-    localtime_r (&NVRAM->alarm, tm);
+    if (rtc_utc)
+        gmtime_r (&NVRAM->alarm, tm);
+    else
+        localtime_r (&NVRAM->alarm, tm);
 #endif
 }