From 2ce677428338c56aeb2c80149fcc52bf4804e9e4 Mon Sep 17 00:00:00 2001 From: Rene de Groot Date: Wed, 3 Jun 2009 11:57:30 +0200 Subject: [PATCH] gps: gps_qemu: Added daylightsaving information is unavailble to broken-down time struct This fixes a problem where mktime() after a first call always returns -1. This results in an mTime=-1000 on android.location.Location objects and thus fails to trigger onLocationChanged(). --- gps/gps_qemu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gps/gps_qemu.c b/gps/gps_qemu.c index 249097d..5c06951 100644 --- a/gps/gps_qemu.c +++ b/gps/gps_qemu.c @@ -247,12 +247,13 @@ nmea_reader_update_time( NmeaReader* r, Token tok ) minute = str2int(tok.p+2, tok.p+4); seconds = str2float(tok.p+4, tok.end); - tm.tm_hour = hour; - tm.tm_min = minute; - tm.tm_sec = (int) seconds; - tm.tm_year = r->utc_year - 1900; - tm.tm_mon = r->utc_mon - 1; - tm.tm_mday = r->utc_day; + tm.tm_hour = hour; + tm.tm_min = minute; + tm.tm_sec = (int) seconds; + tm.tm_year = r->utc_year - 1900; + tm.tm_mon = r->utc_mon - 1; + tm.tm_mday = r->utc_day; + tm.tm_isdst = -1; fix_time = mktime( &tm ) + r->utc_diff; r->fix.timestamp = (long long)fix_time * 1000; -- 2.11.0