Commit 36cbaae5cc21fbd0a12fbb256e941c485bcf0ced

Authored by blueswir1
1 parent 327ac2e7

Use UTC/localtime flag in M48Txx


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3111 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 8 additions and 2 deletions
hw/m48t59.c
@@ -80,7 +80,10 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm) @@ -80,7 +80,10 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm)
80 #ifdef _WIN32 80 #ifdef _WIN32
81 memcpy(tm,localtime(&t),sizeof(*tm)); 81 memcpy(tm,localtime(&t),sizeof(*tm));
82 #else 82 #else
83 - localtime_r (&t, tm) ; 83 + if (rtc_utc)
  84 + gmtime_r (&t, tm);
  85 + else
  86 + localtime_r (&t, tm) ;
84 #endif 87 #endif
85 } 88 }
86 89
@@ -146,7 +149,10 @@ static void get_alarm (m48t59_t *NVRAM, struct tm *tm) @@ -146,7 +149,10 @@ static void get_alarm (m48t59_t *NVRAM, struct tm *tm)
146 #ifdef _WIN32 149 #ifdef _WIN32
147 memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm)); 150 memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm));
148 #else 151 #else
149 - localtime_r (&NVRAM->alarm, tm); 152 + if (rtc_utc)
  153 + gmtime_r (&NVRAM->alarm, tm);
  154 + else
  155 + localtime_r (&NVRAM->alarm, tm);
150 #endif 156 #endif
151 } 157 }
152 158