diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-01-23 06:29:36 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-23 06:29:36 -0500 |
commit | e5f1d945ebc560f7bfb60f120c7747b10a365332 (patch) | |
tree | 4375882f034cd7c1527e10a82b1e942e0b4deddb /gpsutils.c | |
parent | a377b9ddf35113f328f1291bcff6db539d11eaf4 (diff) | |
download | gpsd-e5f1d945ebc560f7bfb60f120c7747b10a365332.tar.gz |
Revert to using internal mkgmtime() as in 3.11.
The experiments since then have failed.
All regression tests pass.
Diffstat (limited to 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -339,7 +339,7 @@ time_t mkgmtime(register struct tm * t) } timestamp_t iso8601_to_unix( /*@in@*/ char *isotime) -/* ISO8601 UTC to Unix UTC */ +/* ISO8601 UTC to Unix UTC, no leapsecond correction. */ { #ifndef USE_QT char *dp = NULL; @@ -352,15 +352,14 @@ timestamp_t iso8601_to_unix( /*@in@*/ char *isotime) usec = strtod(dp, NULL); else usec = 0; - /* - * This is a glibc dependency; timegm() is not standard. It would - * be nice if we could say mktime(&tm) - timezone + usec instead, - * but that seems to fail on newer Fedora versions in a way that - * suggests timezone is being set improperly (off by an hour). - * Also timezon is not available at all on some BSDs. + * It would be nice if we could say mktime(&tm) - timezone + usec instead, + * but timezone is not available at all on some BSDs. Besides, when working + * with historical dates the value of timezone after an ordinary tzset(3) + * can be wrong; you have to do a redirect through the IANA historical + * timezone database to get it right. */ - /*@i1@*/return (timestamp_t)timegm(&tm) + usec; + return (timestamp_t)mkgmtime(&tm) + usec; #else double usec = 0; |