summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-01-23 06:29:36 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-01-23 06:29:36 -0500
commite5f1d945ebc560f7bfb60f120c7747b10a365332 (patch)
tree4375882f034cd7c1527e10a82b1e942e0b4deddb /gpsutils.c
parenta377b9ddf35113f328f1291bcff6db539d11eaf4 (diff)
downloadgpsd-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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gpsutils.c b/gpsutils.c
index 65d428af..31bc4e57 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -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;