summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-01-14 17:06:11 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-01-14 17:06:11 -0500
commiteb3a673af3b681b4e164849d9a5752fa7366e2fe (patch)
treec31d0fcec21096939f2e601747b11dc8923299ee /gpsutils.c
parent4c164e09a4fac4f722d550ef3656a8b782cbd35e (diff)
downloadgpsd-eb3a673af3b681b4e164849d9a5752fa7366e2fe.tar.gz
Revert to using timegm() following Hal Murray's report of Fedora flakiness.
All regression tests pass.
Diffstat (limited to 'gpsutils.c')
-rw-r--r--gpsutils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gpsutils.c b/gpsutils.c
index b1554593..eb70e179 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -354,10 +354,13 @@ timestamp_t iso8601_to_unix( /*@in@*/ char *isotime)
usec = 0;
/*
- * This could be "return (timestamp_t)timegm(&tm) + usec;" but
- * that is glibc only.
+ * 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.
*/
- return (timestamp_t)mktime(&tm) - timezone + usec;
+ return (timestamp_t)timegm(&tm) + usec;
#else
double usec = 0;