diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-09-29 15:39:19 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-09-29 15:39:19 -0400 |
commit | 76118dd9a35eb1516aee287d3aaa8f3824a712fb (patch) | |
tree | 65403bab9b535e2922342e527d732cb9fd8ff032 /driver_superstar2.c | |
parent | 0a36cb1944a53cb206161997da44486d7c95e712 (diff) | |
download | gpsd-76118dd9a35eb1516aee287d3aaa8f3824a712fb.tar.gz |
Better way to avoid glibc dependency.
Returns us to something amost identical to the original code.
Sigh. Timezones are a swamp.
All regression tests pass.
Diffstat (limited to 'driver_superstar2.c')
-rw-r--r-- | driver_superstar2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/driver_superstar2.c b/driver_superstar2.c index c5893afc..743d2133 100644 --- a/driver_superstar2.c +++ b/driver_superstar2.c @@ -99,7 +99,7 @@ superstar2_msg_navsol_lla(struct gps_device_t *session, tm.tm_mday = (int)getub(buf, 14); tm.tm_mon = (int)getub(buf, 15) - 1; tm.tm_year = (int)getleu16(buf, 16) - 1900; - session->newdata.time = (timestamp_t)timegm(&tm) + (d - tm.tm_sec); + session->newdata.time = (timestamp_t)mkgmtime(&tm) + (d - tm.tm_sec); mask |= TIME_SET | PPSTIME_IS; /* extract the local tangential plane (ENU) solution */ @@ -269,7 +269,7 @@ superstar2_msg_timing(struct gps_device_t *session, unsigned char *buf, tm.tm_min = (int)getsb(buf, 42); d = getled64((char *)buf, 43); tm.tm_sec = (int)d; - session->newdata.time = (timestamp_t)timegm(&tm); + session->newdata.time = (timestamp_t)mkgmtime(&tm); session->context->leap_seconds = (int)getsb(buf, 20); mask = TIME_SET | PPSTIME_IS; } |